@revideo/core / types / Color
Class: Color
Defined in: types/Color.ts:62
Represents a color using RGBA values (0-1 range).
Implements
Constructors
Constructor
new Color(
value?):Color
Defined in: types/Color.ts:71
Parameters
value?
Returns
Color
Properties
a
readonlya:number
Defined in: types/Color.ts:69
b
readonlyb:number
Defined in: types/Color.ts:68
g
readonlyg:number
Defined in: types/Color.ts:67
r
readonlyr:number
Defined in: types/Color.ts:66
symbol
readonlysymbol:symbol=Color.symbol
Defined in: types/Color.ts:64
symbol
staticsymbol:symbol
Defined in: types/Color.ts:63
Methods
alpha()
alpha():
number
Defined in: types/Color.ts:264
Returns the alpha value of the color (0-1 range).
Returns
number
css()
css():
string
Defined in: types/Color.ts:254
Serializes the color to an rgb() CSS string (omitting alpha).
Returns
string
hex()
hex():
string
Defined in: types/Color.ts:271
Serializes the color to an RRGGBBAA hex string using culori.
Returns
string
lerp()
lerp(
to,value,mode?):Color
Defined in: types/Color.ts:285
Linearly interpolates from this color to another using LCH space.
Parameters
to
value
number
mode?
CuloriInterpolatorMode = 'lch'
Returns
Color
serialize()
serialize():
string
Defined in: types/Color.ts:242
Serializes the color to an rgba() CSS string.
Returns
string
toSymbol()
toSymbol():
symbol
Defined in: types/Color.ts:221
Returns
symbol
Implementation of
toUniform()
toUniform(
gl,location):void
Defined in: types/Color.ts:232
Parameters
gl
WebGL2RenderingContext
location
WebGLUniformLocation
Returns
void
Implementation of
createLerp()
staticcreateLerp(mode?):InterpolationFunction<Color,any[]>
Defined in: types/Color.ts:199
Creates an interpolation function for colors (uses LCH space via culori).
Parameters
mode?
CuloriInterpolatorMode = 'lch'
Returns
InterpolationFunction<Color, any[]>
createSignal()
staticcreateSignal(initial?,interpolation?):ColorSignal<void>
Defined in: types/Color.ts:209
Creates a signal for the Color type.
Parameters
initial?
interpolation?
InterpolationFunction<Color> = Color.lerp
Returns
ColorSignal<void>
lerp()
staticlerp(from,to,value,mode?):Color
Defined in: types/Color.ts:141
Interpolates between two colors using LCH color space.
Parameters
from
PossibleColor | null
to
PossibleColor | null
value
number
mode?
CuloriInterpolatorMode = 'lch'
Returns
Color