Remoto - VFS: color Class Reference
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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ color()

color (   r,
  g,
  b,
  m 
)

Construct a color object.

Parameters
rthe red or hue component
gthe green or saturation component
bthe blue or value component
mthe 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.

See also
color.html

Member Function Documentation

◆ blue()

setter blue

a getter DOCME

a setter DOCME

◆ fromHTML()

fromHTML (   html)
Parameters
html
Returns

DOCME

◆ green()

setter green

a getter DOCME

a setter DOCME

◆ HSVtoRGB()

HSVtoRGB (   h,
  s,
  v 
)
Parameters
h
s
v
Returns

DOCME

◆ html()

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:

RGB
#RGB
RRGGBB
#RRGGBB

Unparseable incoming HTML color strings will result in an error red value: #FF0000.

◆ hue()

setter hue

a getter DOCME

a setter DOCME

◆ invert()

invert ( )

DOCME

◆ lerp()

lerp (   c1,
  c2,
  amount 
)

Linearly interpolate between teo colors.

Parameters
c1First color
c2Second color
amountInterpolation position, bounded on [0,1]

◆ lum()

setter lum

getter DOCME

setter DOCME

◆ luminance()

getter luminance

a getter DOCME

◆ randomHSV()

randomHSV (   huecenter,
  huerange,
  sat,
  val 
)

Create a random HSV color based on a hue range and saturation and value.

Parameters
huecenter
huerange
sat
val
Returns
a new color object

DOCME

◆ red()

setter red

a getter DOCME

a setter DOCME

◆ RGBtoHSV()

RGBtoHSV (   r,
  g,
  b 
)
Parameters
r
g
b
Returns

DOCME

◆ sat()

setter sat

a getter DOCME

a setter DOCME

◆ setFromHSV()

setFromHSV (   h,
  s,
  v 
)
Parameters
h
s
v

DOCME

◆ spad()

spad (   s)
Parameters
s
Returns

DOCME


The documentation for this class was generated from the following file: