Skip to content

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.


Color.white returns Color

A constant for [1,1,1,1]. Note: don't modify the return value.

Color.black returns Color

A constant for [0,0,0,1]. Note: don't modify the return value.

Color.clear returns Color

A constant for [0,0,0,0]. Note: don't modify the return value.

Color.pink returns Color

The luxe pink color used everywhere. Note: don't modify the return value.

Color.red returns Color

The luxe red color. Note: don't modify the return value.

Color.green returns Color

The luxe green color. Note: don't modify the return value.

Color.blue returns Color

The luxe blue color. Note: don't modify the return value.

Color.hex(value: Num) returns Color

Returns a new color from the specified hex color value.

var color = Color.hex(0xFF00AA)

Color.clone(other: Color, alpha: Num) returns 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.hex_string(color: Color) returns String

Returns a hex string from the specified color.

Color.hex_string(Color.white) //#FFFFFF

Color.hex_string(color: Color, alpha: Bool) returns String

Returns a hex string from the specified color. If alpha is true, includes the alpha component.

Color.hex_string(Color.white, true) //#FFFFFFFF

Color.hex(value: Num, alpha: Num) returns 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_set(color: Color, hex: Num) returns unknown

Set an existing color to the specified hex color value.

var color = Color.hex_set(0xFF00AA)

Color.hex_color(color: Color) returns Num

Get the hex color value of a color

Color.hex_color(color: Color, include_alpha: Bool) returns Num

Get the hex color value of a color, either 3 byte or 4 byte with alpha

Color.lerp(from: Color, to: Color, t: Num) returns 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 use lerp(from, to, 0.5). If t is 0, from is returned and if t is 1, to is returned.

Color.lerp(from: Color, to: Color, t: Num, into: Color) returns 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 use lerp(from, to, 0.5). If t is 0, from is returned and if t is 1, to is returned.

Color.rgb2hsv(rgb: Color) returns Color

Convert from an RGB format color to an HSV format.

Color.hsv2rgb(hsv: Color) returns Color

Convert an HSV format color to an RGB format.

Color.color_from_hue(hue: Num) returns Color

Create a color from the given hue, in a 0...1 range. Values outside 0...1 are wrapped into 0...1 range.

Color.linear_srgb_to_oklab(r: Num, g: Num, b: Num) returns unknown

no docs found

Color.oklab_to_linear_srgb(L: Num, a: Num, b: Num) returns unknown

no docs found

Color.okhsl_to_srgb(h: Num, s: Num, l: Num) returns unknown

no docs found

Color.srgb_to_okhsl(r: Num, g: Num, b: Num) returns unknown

no docs found

Color.okhsv_to_srgb(h: Num, s: Num, v: Num) returns unknown

no docs found

Color.srgb_to_okhsv(r: Num, g: Num, b: Num) returns unknown

no docs found

Color.find_cusp(a: Any, b: Any) returns unknown

no docs found

Color.compute_max_saturation(a: Num, b: Num) returns unknown

no docs found

Color.find_gamut_intersection(a: Any, b: Any, L1: Any, C1: Any, L0: Any, cusp: Any) returns unknown

no docs found