¶
luxe
API (2025.1.2
)¶
luxe: color
module¶
Color¶
import "luxe: color" for Color
Access to color APIs. Note that this is not done at all.
- white
- black
- clear
- pink
- red
- green
- blue
- hex(value:
Num
) - clone(other:
Color
, alpha:Num
) - hex_string(color:
Color
) - hex_string(color:
Color
, alpha:Bool
) - hex(value:
Num
, alpha:Num
) - hex_set(color:
Color
, hex:Num
) - hex_color(color:
Color
) - hex_color(color:
Color
, include_alpha:Bool
) - lerp(from:
Color
, to:Color
, t:Num
) - lerp(from:
Color
, to:Color
, t:Num
, into:Color
) - rgb2hsv(rgb:
Color
) - hsv2rgb(hsv:
Color
) - color_from_hue(hue:
Num
) - linear_srgb_to_oklab(r:
Num
, g:Num
, b:Num
) - oklab_to_linear_srgb(L:
Num
, a:Num
, b:Num
) - okhsl_to_srgb(h:
Num
, s:Num
, l:Num
) - srgb_to_okhsl(r:
Num
, g:Num
, b:Num
) - okhsv_to_srgb(h:
Num
, s:Num
, v:Num
) - srgb_to_okhsv(r:
Num
, g:Num
, b:Num
) - find_cusp(a:
Any
, b:Any
) - compute_max_saturation(a:
Num
, b:Num
) - find_gamut_intersection(a:
Any
, b:Any
, L1:Any
, C1:Any
, L0:Any
, cusp:Any
)
Color
A constant for [1,1,1,1]. Note: don't modify the return value.
Color
A constant for [0,0,0,1]. Note: don't modify the return value.
Color
A constant for [0,0,0,0]. Note: don't modify the return value.
Color
The luxe pink color used everywhere. Note: don't modify the return value.
Color
The luxe red color. Note: don't modify the return value.
Color
The luxe green color. Note: don't modify the return value.
Color
The luxe blue color. Note: don't modify the return value.
Num
)
¶Color
Returns a new color from the specified hex color value.
var color = Color.hex(0xFF00AA)
Color
, alpha: Num
)
¶unknown
Returns a new color from the specified color with a different alpha.
var other = Color.hex(0xFF00AA) var color = Color.clone(other, 0.5)
Color
)
¶String
Returns a hex string from the specified color.
Color.hex_string(Color.white) //#FFFFFF
Color
, alpha: Bool
)
¶String
Returns a hex string from the specified color. If
alpha
is true, includes the alpha component.Color.hex_string(Color.white, true) //#FFFFFFFF
Num
, alpha: Num
)
¶Color
Returns a new color from the specified hex color value, with the specified alpha value.
var color = Color.hex(0xFF00AA, 0.5)
Color
, hex: Num
)
¶unknown
Set an existing color to the specified hex color value.
var color = Color.hex_set(0xFF00AA)
Color
)
¶Num
Get the hex color value of a color
Color
, include_alpha: Bool
)
¶Num
Get the hex color value of a color, either 3 byte or 4 byte with alpha
Color
, to: Color
, t: Num
)
¶Color
Linearly interpolate between two colors, using
t
as the distance between the two in 0...1 range. To blend two colors half and half, you'd uselerp(from, to, 0.5)
. Ift
is0
,from
is returned and ift
is1
,to
is returned.
Color
, to: Color
, t: Num
, into: Color
)
¶unknown
Linearly interpolate between two colors, storing the result in the existing color
into
.t
is the distance between the two in 0...1 range. To blend two colors half and half, you'd uselerp(from, to, 0.5)
. Ift
is0
,from
is returned and ift
is1
,to
is returned.
Color
)
¶Color
Convert from an RGB format color to an HSV format.
Color
)
¶Color
Convert an HSV format color to an RGB format.
Num
)
¶Color
Create a color from the given hue, in a 0...1 range. Values outside 0...1 are wrapped into 0...1 range.
Num
, g: Num
, b: Num
)
¶unknown
no docs found
Num
, a: Num
, b: Num
)
¶unknown
no docs found
Num
, s: Num
, l: Num
)
¶unknown
no docs found
Num
, g: Num
, b: Num
)
¶unknown
no docs found
Num
, s: Num
, v: Num
)
¶unknown
no docs found
Num
, g: Num
, b: Num
)
¶unknown
no docs found
Any
, b: Any
)
¶unknown
no docs found
Num
, b: Num
)
¶unknown
no docs found
Any
, b: Any
, L1: Any
, C1: Any
, L0: Any
, cusp: Any
)
¶unknown
no docs found