color
Properties
aqua
Type: const color
Is a named constant for #00BCD4 color.
black
Type: const color
Is a named constant for #363A45 color.
blue
Type: const color
Is a named constant for #2962ff color.
fuchsia
Type: const color
Is a named constant for #E040FB color.
gray
Type: const color
Is a named constant for #787B86 color.
green
Type: const color
Is a named constant for #4CAF50 color.
lime
Type: const color
Is a named constant for #00E676 color.
maroon
Type: const color
Is a named constant for #880E4F color.
navy
Type: const color
Is a named constant for #311B92 color.
olive
Type: const color
Is a named constant for #808000 color.
orange
Type: const color
Is a named constant for #FF9800 color.
purple
Type: const color
Is a named constant for #9C27B0 color.
red
Type: const color
Is a named constant for #F23645 color.
silver
Type: const color
Is a named constant for #B2B5BE color.
teal
Type: const color
Is a named constant for #089981 color.
white
Type: const color
Is a named constant for #FFFFFF color.
yellow
Type: const color
Is a named constant for #FDD835 color.
Functions
b
color.b(color color) → floatReturns the blue component of the given color.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
color | color | The color to extract the blue component from. |
Returns: float — A value in the range [0, 255].
from_gradient
color.from_gradient(
float value,
float bottom_value,
float top_value,
color bottom_color,
color top_color
) → colorCreates a color that is a gradient between bottom_color and top_color based on the value between bottom_value and top_value.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
value | float | The value to use for interpolation (between bottom_value and top_value). | |
bottom_value | float | The lower bound of the value range. | |
top_value | float | The upper bound of the value range. | |
bottom_color | color | The color to use when value equals bottom_value. | |
top_color | color | The color to use when value equals top_value. |
Returns: color
g
color.g(color color) → floatReturns the green component of the given color.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
color | color | The color to extract the green component from. |
Returns: float — A value in the range [0, 255].
new
color.new(color color, float transp) → colorCreates a new color by changing the transparency of the given color to transp (0-100).
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
color | color | The color to modify. | |
transp | float | The new transparency value (0-100). |
Returns: color
r
color.r(color color) → floatReturns the red component of the given color.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
color | color | The color to extract the red component from. |
Returns: float — A value in the range [0, 255].
rgb
color.rgb(float red, float green, float blue, float transp = 0) → colorCreates a color from the specified red, green, blue components (0-255) and optional transparency (0-100).
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
red | float | The red component value (0-255). | |
green | float | The green component value (0-255). | |
blue | float | The blue component value (0-255). | |
transp | float | 0 | The transparency value (0-100, default: 0.0). |
Returns: color
t
color.t(color color) → floatReturns the transparency component of the given color.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
color | color | The color to extract the transparency component from. |
Returns: float — A value in the range [0, 100] where 0 is fully opaque and 100 is fully transparent.