xyzw-rgba · version 0.9.5

/source/convertRGB.js:floatToInt(f)37-39

Returns the rgb8 value representing f

Import

import { floatToInt } from 'xyzw-rgba/source/convertRGB.js'

Signature

{int} floatToInt({number} f)

Arguments

{number} f

The floating point value

Returns

{int}

/source/convertRGB.js:intToFloat(i)46-48

Returns the floating point value representing i

Import

import { intToFloat } from 'xyzw-rgba/source/convertRGB.js'

Signature

{number} intToFloat({int} i)

Arguments

{int} i

The rgb8 value

Returns

{number}

/source/convertRGB.js:floatToPct(f)55-57

Returns the percent value representing f

Import

import { floatToPct } from 'xyzw-rgba/source/convertRGB.js'

Signature

{int} floatToPct({number} f)

Arguments

{number} f

The floating point value

Returns

{int}

/source/convertRGB.js:pctToFloat(i)64-66

Returns the floating point value representing i

Import

import { pctToFloat } from 'xyzw-rgba/source/convertRGB.js'

Signature

{number} pctToFloat({int} i)

Arguments

{int} i

The percent value

Returns

{number}

/source/convertRGB.js:radToDeg(f)73-78

Returns the degree value representing f

Import

import { radToDeg } from 'xyzw-rgba/source/convertRGB.js'

Signature

{int} radToDeg({number} f)

Arguments

{number} f

The radian value

Returns

{int}

/source/convertRGB.js:degToRad(i)85-91

Returns the radian value representing i

Import

import { degToRad } from 'xyzw-rgba/source/convertRGB.js'

Signature

{number} degToRad({int} i)

Arguments

{int} i

The degree value

Returns

{number}

/source/convertRGB.js:intIntIntToFloat(abc)99-105

Returns the floating point value representation of abc

Import

import { intIntIntToFloat } from 'xyzw-rgba/source/convertRGB.js'

Signature

{number[]} intIntIntToFloat({int[]} abc)

Arguments

{int[]} abc

The rgb8-rgb8-rgb8 components

Returns

{number[]}

/source/convertRGB.js:floatToIntIntInt(a)112-118

Returns the rgb8 representation of abc

Import

import { floatToIntIntInt } from 'xyzw-rgba/source/convertRGB.js'

Signature

{int[]} floatToIntIntInt({number[]} a)

Arguments

{number[]} a

The float-float-float components

Returns

{int[]}

/source/convertRGB.js:degPctPctToFloat(abc)125-131

Returns the floating point representation of abc

Import

import { degPctPctToFloat } from 'xyzw-rgba/source/convertRGB.js'

Signature

{number[]} degPctPctToFloat({int[]} abc)

Arguments

{int[]} abc

The deg-pct-pct components

Returns

{number[]}

/source/convertRGB.js:floatToDegPctPct(abc)138-144

Returns the deg-pct-pct representation of abc

Import

import { floatToDegPctPct } from 'xyzw-rgba/source/convertRGB.js'

Signature

{int[]} floatToDegPctPct({number[]} abc)

Arguments

{number[]} abc

The float-float-float components

Returns

{int[]}

/source/css.js:parse(css)199-225

Returns the component descriptor representing css

Import

import { parse } from 'xyzw-rgba/source/css.js'

Signature

{Object} parse({string} css)

Arguments

{string} css

The color

Returns

{Object}

Throws

{TypeError}

if css is not a valid css color

/source/css.js:stringify(descriptor)236-255

Returns the shortest css string representing the color descriptor

Import

import { stringify } from 'xyzw-rgba/source/css.js'

Signature

{string} stringify({Object} descriptor)

Arguments

{Object} descriptor
{string} descriptor.type

The color model type

{number[]} descriptor.components

The color components

Returns

{string}

Throws

{TypeError}

if descriptor.type is not a valid color model type

{TypeError}

if descriptor.components is not an array

/source/hsl.js:chroma(s, l)12-14

Returns the chroma of s and l

Import

import { chroma } from 'xyzw-rgba/source/hsl.js'

Signature

{number} chroma({number} s, {number} l)

Arguments

{number} s

The saturation

{number} l

The luminosity

Returns

{number}

/source/hsl.js:hslToRgb(hsl)22-44

Returns the [r,g,b] representation of [h,s,l]

Import

import { hslToRgb } from 'xyzw-rgba/source/hsl.js'

Signature

{number[]} hslToRgb({number[]} hsl)

Arguments

{number[]} hsl

The hsl components

Returns

{number[]}

/source/hsl.js:rgbToHsl(rgb)51-69

Returns the [h,s,l] representation of [r,g,b]

Import

import { rgbToHsl } from 'xyzw-rgba/source/hsl.js'

Signature

{number[]} rgbToHsl({number[]} rgb)

Arguments

{number[]} rgb

The rgb components

Returns

{number[]}

/source/HSLA.js:HSLA15-207

HSLA color model transform

Import

import { HSLA } from 'xyzw-rgba/source/HSLA.js'

.Define(h, s, l, a, target)26-31

Returns a defined instance

Signature

{HSLA} HSLA.Define({number} h, {number} s, {number} l, {number} a [, {HSLA} target])

Arguments

{number} h

The hue in radians

{number} s

The saturation

{number} l

The luminosity

{number} a

The alpha

{HSLA} target optional

The target instance

Returns

{HSLA}

.RGBA(v, target)39-43

Returns an instance representing v

Signature

{HSLA} HSLA.RGBA({Vector4} v [, {HSLA} target])

Arguments

{Vector4} v

The source rgba vector

{HSLA} target optional

The target instance

Returns

{HSLA}

.RGB(v, target)51-55

Returns an instance representing v

Signature

{HSLA} HSLA.RGB({Vector3} v [, {HSLA} target])

Arguments

{Vector3} v

The source rgb vector

{HSLA} target optional

The target instance

Returns

{HSLA}

.Copy(source, target)64-66

Returns the copy of source

Signature

{HSLA} HSLA.Copy({HSLA} source [, {HSLA} target])

Arguments

{HSLA} source

The source instance

{HSLA} target optional

The target instance

Returns

{HSLA}

.isEQ(a, b)75-77

Returns true if a == b, false otherwise

Signature

{boolean} HSLA.isEQ({HSLA} a, {HSLA} b)

Arguments

{HSLA} a
{HSLA} b

Returns

{boolean}

#constructor(h, s, l, a)88-109

Creates a new instance

Signature

{undefined} HSLA#constructor({number} h, {number} s, {number} l, {number} a)

Arguments

{number} h

The hue in radians

{number} s

The saturation

{number} l

The luminosity

{number} a

The alpha

Returns

No return value

#h93-93

The hue

Signature

{number} HSLA#h

#s98-98

The saturation

Signature

{number} HSLA#s

#l103-103

The luminosity

Signature

{number} HSLA#l

#a108-108

The alpha

Signature

{number} HSLA#a

#define(h, s, l, a)120-124

Redefines the instance

Signature

{HSLA} HSLA#define({number} h, {number} s, {number} l, {number} a)

Arguments

{number} h

The hue in radians

{number} s

The saturation

{number} l

The luminosity

{number} a

The alpha

Returns

{HSLA}

#chroma131-133

The chroma

Signature

{number} HSLA#chroma

#copyOf(source)141-148

The copy of source

Signature

{HSLA} HSLA#copyOf({HSLA} source)

Arguments

{HSLA} source

The source instance

Returns

{HSLA}

#toRGBA(target)156-164

Returns a Vector4 rgba representation of the instance

Signature

{Vector4} HSLA#toRGBA([{Vector4} target])

Arguments

{Vector4} target optional

the target vector

Returns

{Vector4}

#toRGB(matte, target)172-185

Returns a Vector3 rgb representation of the instance

Signature

{Vector3} HSLA#toRGB([{Vector3} matte [, {Vector3} target]])

Arguments

{Vector3} matte optional

The alpha matte rgb vector

{Vector3} target optional

The target vector

Returns

{Vector3}

#toCSS()191-198

Returns a css-formated hsl or hsla representation of the instance

Signature

{string} HSLA#toCSS()

Arguments

None

Returns

{string}

#toString()204-206

Returns a string representation of the instance

Signature

{string} HSLA#toString()

Arguments

None

Returns

{string}

/source/Vector3RGB.js:Vector3RGB augments Vector318-161

RGB three component vector representation

Import

import { Vector3RGB } from 'xyzw-rgba/source/Vector3RGB.js'

.Define(n, target)26-31

Returns a new instance

Signature

{Vector3RGB} Vector3RGB.Define({number[]} n [, {Vector3RGB} target])

Arguments

{number[]} n

The components

{Vector3RGB} target optional

The target instance

Returns

{Vector3RGB}

.CSS(string, matte, target)41-52

Returns an instance representing string

Signature

{Vector3RGB} Vector3RGB.CSS({string} string [, {Vector3} matte [, {Vector3RGB} target]])

Arguments

{string} string

The css color string

{Vector3} matte optional

The transparency matte vector

{Vector3RGB} target optional

The target instance

Returns

{Vector3RGB}

.Int(i, target)60-66

Returns an instance representing 0xrrggbb hex encoded i

Signature

{Vector3RGB} Vector3RGB.Int({int} i [, {Vector3} target])

Arguments

{int} i

The bit encoded Int

{Vector3} target optional

The target instance

Returns

{Vector3RGB}

#r74-76

The r component Alias of Vector3#x

Signature

{number} Vector3RGB#r

#g88-90

The g component Alias of Vector3#y

Signature

{number} Vector3RGB#g

#b102-104

The b component Alias of Vector3#z

Signature

{number} Vector3RGB#b

#toCSS(fast)116-132

Returns a css representation of the instance

Signature

{string} Vector3RGB#toCSS([{bool} fast=false])

Arguments

{bool} fast optionaldefaultfalse

True if string should be generated fast, false if generated string should be small

Returns

{string}

#toInt()139-143

Returns a 0xrrggbb hex encoded integer representation of the instance

Signature

{int} Vector3RGB#toInt()

Arguments

None

Returns

{int}

#toString()150-152

Returns a css representation of the instance

Signature

{string} Vector3RGB#toString()

Arguments

None

Returns

{string}

#valueOf()158-160

Returns a rrggbb hex encoded representation of the instance

Signature

{int} Vector3RGB#valueOf()

Arguments

None

Returns

{int}

/source/Vector4RGBA.js:Vector4RGBA augments Vector418-177

RGBA Four component vector representation

Import

import { Vector4RGBA } from 'xyzw-rgba/source/Vector4RGBA.js'

.Define(n, target)26-31

Returns a defined instance

Signature

{Vector4RGBA} Vector4RGBA.Define({number[]} n [, {Vector4RGBA} target])

Arguments

{number[]} n

The components

{Vector4RGBA} target optional

The target instance

Returns

{Vector4RGBA}

.CSS(string, target)40-51

Returns an instance representing string

Signature

{Vector4RGBA} Vector4RGBA.CSS({string} string [, {Vector4RGBA} target])

Arguments

{string} string

The css color string

{Vector4RGBA} target optional

The target instance

Returns

{Vector4RGBA}

.Int(i, target)59-66

Returns an instance representing 0xaarrggbb hex encoded i

Signature

{Vector4RGBA} Vector4RGBA.Int({int} i [, {Vector4RGBA} target])

Arguments

{int} i

The hex encoded color

{Vector4RGBA} target optional

The target instance

Returns

{Vector4RGBA}

#r74-76

The r component Alias of Vector4#x

Signature

{number} Vector4RGBA#r

#g88-90

The g component Alias of Vector4#y

Signature

{number} Vector4RGBA#g

#b102-104

The b component Alias of Vector4#z

Signature

{number} Vector4RGBA#b

#a116-118

The a component Alias of Vector4#w

Signature

{number} Vector4RGBA#a

#toCSS(fast)130-146

Returns a css color string representation of the instance

Signature

{string} Vector4RGBA#toCSS([{bool} fast=false])

Arguments

{bool} fast optionaldefaultfalse

True if css string should be generated fast, false if generated string should be small

Returns

{string}

#toInt()152-159

Returns a 0xaarrggbb hex encoded integer representation of the instance

Signature

{int} Vector4RGBA#toInt()

Arguments

None

Returns

{int}

#toString()166-168

Returns a css color string representation of the instance

Signature

{string} Vector4RGBA#toString()

Arguments

None

Returns

{string}

#valueOf()174-176

Returns a aarrggbb hex encoded int representation of the instance

Signature

{int} Vector4RGBA#valueOf()

Arguments

None

Returns

{int}