colors.ts

view source

Declarations
#

21 declarations

Blue
#

Green
#

hex_string_to_hsl
#

colors.ts view source

(hex: string): Hsl import {hex_string_to_hsl} from '@fuzdev/fuz_util/colors.js';

hex

type string

returns

Hsl

hex_string_to_rgb
#

colors.ts view source

(hex: string): Rgb import {hex_string_to_rgb} from '@fuzdev/fuz_util/colors.js';

hex

type string

returns

Rgb

hex_to_rgb
#

colors.ts view source

(hex: number): Rgb import {hex_to_rgb} from '@fuzdev/fuz_util/colors.js';

Converts a hex color to an RGB color.

hex

type number

returns

Rgb

Hsl
#

hsl_to_hex
#

hsl_to_hex_string
#

hsl_to_rgb
#

hsl_to_string
#

Hue
#

hue_to_rgb_component
#

colors.ts view source

(p: number, q: number, t: number): number import {hue_to_rgb_component} from '@fuzdev/fuz_util/colors.js';

p

type number

q

type number

t

type number

returns

number

Lightness
#

parse_hsl_string
#

colors.ts view source

(hsl: string): Hsl import {parse_hsl_string} from '@fuzdev/fuz_util/colors.js';

hsl

type string

returns

Hsl

Red
#

Rgb
#

rgb_to_hex
#

colors.ts view source

(r: number, g: number, b: number): number import {rgb_to_hex} from '@fuzdev/fuz_util/colors.js';

Converts an RGB color to a hex color.

r

type number

g

type number

b

type number

returns

number

rgb_to_hex_string
#

colors.ts view source

(r: number, g: number, b: number): string import {rgb_to_hex_string} from '@fuzdev/fuz_util/colors.js';

r

type number

g

type number

b

type number

returns

string

rgb_to_hsl
#

colors.ts view source

(r: number, g: number, b: number): Hsl import {rgb_to_hsl} from '@fuzdev/fuz_util/colors.js';

Converts an RGB color value to HSL. Conversion formula adapted from http://wikipedia.org/wiki/HSL_color_space. Values r/g/b are in the range [0,255] and returns h/s/l in the range [0,1].

r

type number

g

type number

b

type number

returns

Hsl

Saturation
#

to_hex_component
#

colors.ts view source

(v: number): string import {to_hex_component} from '@fuzdev/fuz_util/colors.js';

v

type number

returns

string

Depends on
#