Skip to content

color

Properties

AQUA

Type: const color

Color constant for #00BCD4.


BLACK

Type: const color

Color constant for #363A45.


BLUE

Type: const color

Color constant for #2962FF.


FUCHSIA

Type: const color

Color constant for #E040FB.


GRAY

Type: const color

Color constant for #787B86.


GREEN

Type: const color

Color constant for #4CAF50.


LIME

Type: const color

Color constant for #00E676.


MAROON

Type: const color

Color constant for #880E4F.


Type: const color

Color constant for #311B92.


OLIVE

Type: const color

Color constant for #808000.


ORANGE

Type: const color

Color constant for #FF9800.


PURPLE

Type: const color

Color constant for #9C27B0.


RED

Type: const color

Color constant for #F23645.


SILVER

Type: const color

Color constant for #B2B5BE.


TEAL

Type: const color

Color constant for #089981.


WHITE

Type: const color

Color constant for #FFFFFF.


YELLOW

Type: const color

Color constant for #FDD835.

Functions

b

navi
color.b(color: color): float

Returns the blue component of the given color.

Parameters

NameTypeDefaultDescription
colorcolorThe color to extract the blue component from.

Returns: float — A value in the range [0, 255].


from_gradient

navi
color.from_gradient(
    value: float,
    bottom_value: float,
    top_value: float,
    bottom_color: color,
    top_color: color
  ): color

Creates a color that is a gradient between bottom_color and top_color based on the value between bottom_value and top_value.

Parameters

NameTypeDefaultDescription
valuefloatThe value to use for interpolation (between bottom_value and top_value).
bottom_valuefloatThe lower bound of the value range.
top_valuefloatThe upper bound of the value range.
bottom_colorcolorThe color to use when value equals bottom_value.
top_colorcolorThe color to use when value equals top_value.

Returns: color


g

navi
color.g(color: color): float

Returns the green component of the given color.

Parameters

NameTypeDefaultDescription
colorcolorThe color to extract the green component from.

Returns: float — A value in the range [0, 255].


new

navi
color.new(color: color, transp: float): color

Creates a new color by changing the transparency of the given color to transp (0-100).

Parameters

NameTypeDefaultDescription
colorcolorThe color to modify.
transpfloatThe new transparency value (0-100).

Returns: color


r

navi
color.r(color: color): float

Returns the red component of the given color.

Parameters

NameTypeDefaultDescription
colorcolorThe color to extract the red component from.

Returns: float — A value in the range [0, 255].


rgb

navi
color.rgb(red: float, green: float, blue: float, transp: float = 0): color

Creates a color from the specified red, green, blue components (0-255) and optional transparency (0-100).

Parameters

NameTypeDefaultDescription
redfloatThe red component value (0-255).
greenfloatThe green component value (0-255).
bluefloatThe blue component value (0-255).
transpfloat0The transparency value (0-100, default: 0.0).

Returns: color


t

navi
color.t(color: color): float

Returns the transparency component of the given color.

Parameters

NameTypeDefaultDescription
colorcolorThe 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.

Released under the MIT License.