Skip to content

@phun-ky/moebius / MoebiusColor

Interface: MoebiusColor ​

Defined in: classes/MoebiusColor.ts:26

MoebiusColor class representing a color with various formats and conversions.

Example ​

ts
const mColor = new MoebiusColor('#ff9900');

Implements ​

Properties ​

cmyk ​

ts
cmyk: MoebiusCMYKObjectType;

Defined in: classes/MoebiusColor.ts:40

Implementation of ​

MoebiusColorInterface.cmyk


color ​

ts
color: MoebiusChromaColorInputType;

Defined in: classes/MoebiusColor.ts:27

Implementation of ​

MoebiusColorInterface.color


hex ​

ts
hex: `#${string}`;

Defined in: classes/MoebiusColor.ts:29

Implementation of ​

MoebiusColorInterface.hex


hsi ​

ts
hsi: MoebiusHSIObjectType;

Defined in: classes/MoebiusColor.ts:38

Implementation of ​

MoebiusColorInterface.hsi


hsl ​

ts
hsl: MoebiusHSLObjectType;

Defined in: classes/MoebiusColor.ts:31

Implementation of ​

MoebiusColorInterface.hsl


hslFloat ​

ts
hslFloat: MoebiusHSLObjectType;

Defined in: classes/MoebiusColor.ts:42

Implementation of ​

MoebiusColorInterface.hslFloat


hsv ​

ts
hsv: MoebiusHSVObjectType;

Defined in: classes/MoebiusColor.ts:33

Implementation of ​

MoebiusColorInterface.hsv


hwb ​

ts
hwb: MoebiusHWBObjectType;

Defined in: classes/MoebiusColor.ts:32

Implementation of ​

MoebiusColorInterface.hwb


lab ​

ts
lab: MoebiusLABObjectType;

Defined in: classes/MoebiusColor.ts:34

Implementation of ​

MoebiusColorInterface.lab


lch ​

ts
lch: MoebiusLCHObjectType;

Defined in: classes/MoebiusColor.ts:36

Implementation of ​

MoebiusColorInterface.lch


name ​

ts
name: string;

Defined in: classes/MoebiusColor.ts:28

Implementation of ​

MoebiusColorInterface.name


oklab ​

ts
oklab: MoebiusLABObjectType;

Defined in: classes/MoebiusColor.ts:39

Implementation of ​

MoebiusColorInterface.oklab


oklch ​

ts
oklch: MoebiusLCHObjectType;

Defined in: classes/MoebiusColor.ts:37

Implementation of ​

MoebiusColorInterface.oklch


rgb ​

ts
rgb: `rgb(${number}, ${number}, ${number})`;

Defined in: classes/MoebiusColor.ts:30

Implementation of ​

MoebiusColorInterface.rgb


rgbFloat ​

ts
rgbFloat: MoebiusRGBObjectType;

Defined in: classes/MoebiusColor.ts:41

Implementation of ​

MoebiusColorInterface.rgbFloat


xyz ​

ts
xyz: MoebiusXYZObjectType;

Defined in: classes/MoebiusColor.ts:35

Implementation of ​

MoebiusColorInterface.xyz

Methods ​

toFloat() ​

Call Signature ​

ts
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 ​

MoebiusHSLObjectType

The floating-point representation of the color in the specified color space.

Call Signature ​

ts
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 ​

MoebiusRGBObjectType

The floating-point representation of the color in the specified color space.

Call Signature ​

ts
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 ​

ts
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 ​

MoebiusHSLObjectType

The color object in the specified color space.

Call Signature ​

ts
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 ​

MoebiusRGBObjectType

The color object in the specified color space.

Call Signature ​

ts
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.