@phun-ky/moebius / MoebiusColor
Interface: MoebiusColor
Defined in: classes/MoebiusColor.ts:26
MoebiusColor class representing a color with various formats and conversions.
Example
const mColor = new MoebiusColor('#ff9900');Implements
Properties
cmyk
cmyk: MoebiusCMYKObjectType;Defined in: classes/MoebiusColor.ts:40
Implementation of
MoebiusColorInterface.cmyk
color
color: MoebiusChromaColorInputType;Defined in: classes/MoebiusColor.ts:27
Implementation of
MoebiusColorInterface.color
hex
hex: `#${string}`;Defined in: classes/MoebiusColor.ts:29
Implementation of
MoebiusColorInterface.hex
hsi
hsi: MoebiusHSIObjectType;Defined in: classes/MoebiusColor.ts:38
Implementation of
MoebiusColorInterface.hsi
hsl
hsl: MoebiusHSLObjectType;Defined in: classes/MoebiusColor.ts:31
Implementation of
MoebiusColorInterface.hsl
hslFloat
hslFloat: MoebiusHSLObjectType;Defined in: classes/MoebiusColor.ts:42
Implementation of
MoebiusColorInterface.hslFloat
hsv
hsv: MoebiusHSVObjectType;Defined in: classes/MoebiusColor.ts:33
Implementation of
MoebiusColorInterface.hsv
hwb
hwb: MoebiusHWBObjectType;Defined in: classes/MoebiusColor.ts:32
Implementation of
MoebiusColorInterface.hwb
lab
lab: MoebiusLABObjectType;Defined in: classes/MoebiusColor.ts:34
Implementation of
MoebiusColorInterface.lab
lch
lch: MoebiusLCHObjectType;Defined in: classes/MoebiusColor.ts:36
Implementation of
MoebiusColorInterface.lch
name
name: string;Defined in: classes/MoebiusColor.ts:28
Implementation of
MoebiusColorInterface.name
oklab
oklab: MoebiusLABObjectType;Defined in: classes/MoebiusColor.ts:39
Implementation of
MoebiusColorInterface.oklab
oklch
oklch: MoebiusLCHObjectType;Defined in: classes/MoebiusColor.ts:37
Implementation of
MoebiusColorInterface.oklch
rgb
rgb: `rgb(${number}, ${number}, ${number})`;Defined in: classes/MoebiusColor.ts:30
Implementation of
MoebiusColorInterface.rgb
rgbFloat
rgbFloat: MoebiusRGBObjectType;Defined in: classes/MoebiusColor.ts:41
Implementation of
MoebiusColorInterface.rgbFloat
xyz
xyz: MoebiusXYZObjectType;Defined in: classes/MoebiusColor.ts:35
Implementation of
MoebiusColorInterface.xyz
Methods
toFloat()
Call Signature
toFloat(type: "hsl"): MoebiusHSLObjectType;Defined in: classes/MoebiusColor.ts:89
Converts the color to a floating-point representation in the specified color space.
Parameters
type
"hsl"
The color space type (e.g., 'rgb' or 'hsl').
Returns
The floating-point representation of the color in the specified color space.
Call Signature
toFloat(type?: "rgb"): MoebiusRGBObjectType;Defined in: classes/MoebiusColor.ts:90
Converts the color to a floating-point representation in the specified color space.
Parameters
type?
"rgb"
The color space type (e.g., 'rgb' or 'hsl').
Returns
The floating-point representation of the color in the specified color space.
Call Signature
toFloat(type?: string):
| MoebiusHSLObjectType
| MoebiusRGBObjectType;Defined in: classes/MoebiusColor.ts:91
Converts the color to a floating-point representation in the specified color space.
Parameters
type?
string
The color space type (e.g., 'rgb' or 'hsl').
Returns
| MoebiusHSLObjectType | MoebiusRGBObjectType
The floating-point representation of the color in the specified color space.
toObject()
Call Signature
toObject(type: "hsl"): MoebiusHSLObjectType;Defined in: classes/MoebiusColor.ts:78
Converts the color to an object in the specified color space.
Parameters
type
"hsl"
The color space type (e.g., 'rgb' or 'hsl').
Returns
The color object in the specified color space.
Call Signature
toObject(type?: "rgb"): MoebiusRGBObjectType;Defined in: classes/MoebiusColor.ts:79
Converts the color to an object in the specified color space.
Parameters
type?
"rgb"
The color space type (e.g., 'rgb' or 'hsl').
Returns
The color object in the specified color space.
Call Signature
toObject(type?: string):
| MoebiusHSLObjectType
| MoebiusRGBObjectType;Defined in: classes/MoebiusColor.ts:80
Converts the color to an object in the specified color space.
Parameters
type?
string
The color space type (e.g., 'rgb' or 'hsl').
Returns
| MoebiusHSLObjectType | MoebiusRGBObjectType
The color object in the specified color space.