API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classColor
32-bit RGBA color value with channel-wise accessors. Red, green, and blue are integers in 0..255; alpha is a float in 0..1. Out-of-range values are clipped on assignment (RGB via bitwise mask, alpha via `clamp`). The class predefines every CSS named color as a static readonly instance (`Color.aliceBlue`, `Color.cornflowerBlue`, …). These shared instances are intentionally shared — do not mutate them; clone first if you need to customize a starting color. Internally caches the packed RGBA32 representation and a normalized `Float32Array` for upload to GPU buffers; both are invalidated on channel writes and rebuilt lazily.
import { Color } from '@codexo/exojs' 32-bit RGBA color value with channel-wise accessors. Red, green, and blue are integers in 0..255; alpha is a float in 0..1. Out-of-range values are clipped on assignment (RGB via bitwise mask, alpha via `clamp`).
The class predefines every CSS named color as a static readonly instance (`Color.aliceBlue`, `Color.cornflowerBlue`, …). These shared instances are intentionally shared — do not mutate them; clone first if you need to customize a starting color.
Internally caches the packed RGBA32 representation and a normalized `Float32Array` for upload to GPU buffers; both are invalidated on channel writes and rebuilt lazily.
new(r: number, g: number, b: number, a: number): Color clone(): this copy(color: Color): this destroy(): void equals(__namedParameters: Partial<Color>): boolean set(r: number, g: number, b: number, a: number): this toArray(normalized: boolean): Float32Array toRgba(): number toString(prefixed: boolean): string aliceBlue: Color antiqueWhite: Color aqua: Color aquamarine: Color azure: Color beige: Color bisque: Color black: Color blanchedAlmond: Color blue: Color blueViolet: Color brown: Color burlyWood: Color cadetBlue: Color chartreuse: Color chocolate: Color coral: Color cornflowerBlue: Color cornsilk: Color crimson: Color cyan: Color darkBlue: Color darkCyan: Color darkGoldenrod: Color darkGray: Color darkGreen: Color darkKhaki: Color darkMagenta: Color darkOliveGreen: Color darkOrange: Color darkOrchid: Color darkRed: Color darkSalmon: Color darkSeaGreen: Color darkSlateBlue: Color darkSlateGray: Color darkTurquoise: Color darkViolet: Color deepPink: Color deepSkyBlue: Color dimGray: Color dodgerBlue: Color firebrick: Color floralWhite: Color forestGreen: Color fuchsia: Color gainsboro: Color ghostWhite: Color gold: Color goldenrod: Color gray: Color green: Color greenYellow: Color honeydew: Color hotPink: Color indianRed: Color indigo: Color ivory: Color khaki: Color lavender: Color lavenderBlush: Color lawnGreen: Color lemonChiffon: Color lightBlue: Color lightCoral: Color lightCyan: Color lightGoldenrodYellow: Color lightGray: Color lightGreen: Color lightPink: Color lightSalmon: Color lightSeaGreen: Color lightSkyBlue: Color lightSlateGray: Color lightSteelBlue: Color lightYellow: Color lime: Color limeGreen: Color linen: Color magenta: Color maroon: Color mediumAquamarine: Color mediumBlue: Color mediumOrchid: Color mediumPurple: Color mediumSeaGreen: Color mediumSlateBlue: Color mediumSpringGreen: Color mediumTurquoise: Color mediumVioletRed: Color midnightBlue: Color mintCream: Color mistyRose: Color moccasin: Color navajoWhite: Color navy: Color oldLace: Color olive: Color oliveDrab: Color orange: Color orangeRed: Color orchid: Color paleGoldenrod: Color paleGreen: Color paleTurquoise: Color paleVioletRed: Color papayaWhip: Color peachPuff: Color peru: Color pink: Color plum: Color powderBlue: Color purple: Color red: Color rosyBrown: Color royalBlue: Color saddleBrown: Color salmon: Color sandyBrown: Color seaGreen: Color seaShell: Color sienna: Color silver: Color skyBlue: Color slateBlue: Color slateGray: Color snow: Color springGreen: Color steelBlue: Color tan: Color teal: Color thistle: Color tomato: Color transparentBlack: Color transparentWhite: Color turquoise: Color violet: Color wheat: Color white: Color whiteSmoke: Color yellow: Color yellowGreen: Color a: number b: number g: number r: number