Skip to content

Convert

rech edited this page Jun 15, 2026 · 1 revision

Description

A class for conversion between color spaces.

Remarks

_

Methods


RGBAToHex(rgba)

Description

Convert a color to a hex value representation in the form #RRGGBBAA.

Parameters

Name Type Description
rgba RGBA The color to convert

Return types

string

Remarks

_

RGBAToHex(r, g, b, a)

Description

Convert a color to a hex value representation in the form #RRGGBBAA.

Parameters

Name Type Description
r number The red component (0-255)
g number The green component (0-255)
b number The blue component (0-255)
a number The alpha component (0-255)

Return types

string

Remarks

_


HexToRGBA(hex)

Description

Convert hex value representation in the form #RRGGBBAA to a color.

Parameters

Name Type Description
hex string The string to convert

Return types

RGBA

Remarks

_


HSVAToHex(hsva)

Description

Convert a color to a hex value representation in the form #RRGGBBAA.

Parameters

Name Type Description
hsva HSVA The color to convert

Return types

string

Remarks

_

HSVAToHex(h, s, v, a)

Description

Convert a color to a hex value representation in the form #RRGGBBAA.

Parameters

Name Type Description
h number The hue component (0-360)
s number The saturation component (0-1)
v number The brightness component (0-1)
a number The alpha component (0-1)

Return types

string

Remarks

_


HexToHSVA(hex)

Description

Convert hex value representation in the form #RRGGBBAA to a HSVA color.

Parameters

Name Type Description
hex string The string to convert

Return types

HSVA

Remarks

_


RGBAToHSVA(rgba)

Description

Convert a color from RGBA color space to HSVA color space.

Parameters

Name Type Description
hex string The string to convert

Return types

HSVA

Remarks

_


RGBAToHSVA(r, g, b, a)

Description

Convert a color from RGBA color space to HSVA color space.

Parameters

Name Type Description
r number The red component (0-255)
g number The green component (0-255)
b number The blue component (0-255)
a number The alpha component (0-255)

Return types

HSVA

Remarks

_


HSVAToRGBA(hsva)

Description

Convert a color from HSVA color space to RGBA color space.

Parameters

Name Type Description
hsva HSVA The color to convert

Return types

RGBA

Remarks

_


HSVAToRGBA(h, s, v, a)

Description

Convert a color from HSVA color space to RGBA color space.

Parameters

Name Type Description
h number The hue component (0-360)
s number The saturation component (0-1)
v number The brightness component (0-1)
a number The alpha component (0-1)

Return types

RGBA

Remarks

_

Clone this wiki locally