Module lib.types
Basic types: at this stage, just LampState
, the basic type
representing an LED, with variable brightness and opacity.
Functions
LampState:cover (lamp) | The result of this LampState instance covering another LampState . |
LampState:new (level, blend) | Create a new lamp. |
LampState:againstBlack () | Get the brightness (only, not opacity) state of a lamp if drawn against black (off). |
Fields
LampState.OFF | The "off" lamp preset: black, opaque. |
LampState.ON | The "on" lamp preset: fully lit, opaque. |
LampState.THRU | The "transparent" lamp preset. |
LampState.FLIP | The "inversion" lamp preset. |
Functions
- LampState:cover (lamp)
-
The result of this
LampState
instance covering anotherLampState
.Parameters:
- lamp the lamp that is being covered
Returns:
-
the calculated lamp value
- LampState:new (level, blend)
-
Create a new lamp.
Parameters:
- level
the brightness of the lamp from
0.0
(off) to1.0
(full). - blend
a kind of normalised opacity;
0.0
is fully opaque,1.0
is fully transparent,-1.0
is full inversion of whatever is below.
Returns:
-
a new lamp
- level
the brightness of the lamp from
- LampState:againstBlack ()
-
Get the brightness (only, not opacity) state of a lamp
if drawn against black (off).
Returns:
-
the brightness,
0.0
to1.0