Remoto - VFS
|
Javascript color object class. More...
#include "remoto!stdlib:js/include/color.js"
Public Member Functions | |
color (r, g, b, m) | |
Construct a color object. More... | |
fromHTML (html) | |
HSVtoRGB (h, s, v) | |
invert () | |
lerp (c1, c2, amount) | |
Linearly interpolate between teo colors. More... | |
randomHSV (huecenter, huerange, sat, val) | |
Create a random HSV color based on a hue range and saturation and value. More... | |
RGBtoHSV (r, g, b) | |
setFromHSV (h, s, v) | |
spad (s) | |
Getters & Setters | |
getter | red |
a getter DOCME More... | |
getter | green |
a getter DOCME More... | |
getter | blue |
a getter DOCME More... | |
getter | hue |
a getter DOCME More... | |
getter | sat |
a getter DOCME More... | |
getter | luminance |
a getter DOCME More... | |
getter | lum |
getter DOCME More... | |
getter | html |
Get the html color representation of this object. More... | |
Javascript color object class.
Color objects can convert from RGB to HSV, in both hex and float formats. A few other color operations are supported.
color | ( | r, | |
g, | |||
b, | |||
m | |||
) |
Construct a color object.
r | the red or hue component |
g | the green or saturation component |
b | the blue or value component |
m | the mode used to construct this object: RGB or HSV |
If the mode is missing, the default mode is RGB.
If only one parameter is provided, it is considered to be an HTML color string, and will be parsed by the color.html setter.
setter blue |
a getter DOCME
a setter DOCME
fromHTML | ( | html | ) |
html |
DOCME
setter green |
a getter DOCME
a setter DOCME
HSVtoRGB | ( | h, | |
s, | |||
v | |||
) |
h | |
s | |
v |
DOCME
setter html |
Get the html color representation of this object.
Set the value of this color by parsing an incoming HTML color.
The returned string will be in the form: #RRGGBB
. Other css color forms are not supported or returned (for instance, rgba(0.0,0.0,0.0,1.0))
Incoming HTML colors can be in the form:
Unparseable incoming HTML color strings will result in an error red value: #FF0000
.
setter hue |
a getter DOCME
a setter DOCME
invert | ( | ) |
DOCME
lerp | ( | c1, | |
c2, | |||
amount | |||
) |
Linearly interpolate between teo colors.
c1 | First color |
c2 | Second color |
amount | Interpolation position, bounded on [0,1] |
setter lum |
getter DOCME
setter DOCME
getter luminance |
a getter DOCME
randomHSV | ( | huecenter, | |
huerange, | |||
sat, | |||
val | |||
) |
Create a random HSV color based on a hue range and saturation and value.
huecenter | |
huerange | |
sat | |
val |
DOCME
setter red |
a getter DOCME
a setter DOCME
RGBtoHSV | ( | r, | |
g, | |||
b | |||
) |
r | |
g | |
b |
DOCME
setter sat |
a getter DOCME
a setter DOCME
setFromHSV | ( | h, | |
s, | |||
v | |||
) |
h | |
s | |
v |
DOCME
spad | ( | s | ) |
s |
DOCME