joliclic

home

Class Index | File Index

Classes


Class kh.color.RGB


Defined in: kh-color.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
kh.color.RGB(r, g, b)
r, g, b Integer in [0, 255]
Field Summary
Field Attributes Field Name and Description
 
b
the blue value of the color in [0, 255]
 
g
the green value of the color in [0, 255]
 
the intensity of the color, like in YUV
 
Indicate if the current color is websafe, http://en.wikipedia.org/wiki/Web_colors#Web-safe_colors
 
r
the red value of the color in [0, 255]
Method Summary
Method Attributes Method Name and Description
<private>  
hex(n)
convert a integer in hexadecimal (should be < 256)
 
toHEXA(threedigit, sharp)
Hexadecimal representation
 
HSL conversion
 
HSV conversion
 
String conversion
 
Returns the nearest color that is websafe, http://en.wikipedia.org/wiki/Web_colors#Web-safe_colors
 
returns the integer nearest the value that be used in the short HTML representation (like in #fff)
Class Detail
kh.color.RGB(r, g, b)
r, g, b Integer in [0, 255]
Parameters:
r
g
b
Field Detail
b
the blue value of the color in [0, 255]

g
the green value of the color in [0, 255]

{Float} intensity
the intensity of the color, like in YUV

{Boolean} isWebSafe
Indicate if the current color is websafe, http://en.wikipedia.org/wiki/Web_colors#Web-safe_colors

r
the red value of the color in [0, 255]
Method Detail
<private> {String} hex(n)
convert a integer in hexadecimal (should be < 256)
Parameters:
{Integer} n
Returns:
{String}

{String} toHEXA(threedigit, sharp)
Hexadecimal representation
Parameters:
{Boolean} threedigit
- return short representation (3 digits, ex: #fff) if possible (default = false)
{Boolean} sharp
- return a # as first character (default = false)
Returns:
{String}

{HSL} toHSL()
HSL conversion
Returns:
{HSL} object

{HSV} toHSV()
HSV conversion
Returns:
{HSV} object

{String} toString()
String conversion
Returns:
{String}

{RGB} toWebSafe()
Returns the nearest color that is websafe, http://en.wikipedia.org/wiki/Web_colors#Web-safe_colors
Returns:
{RGB} object

{Integer} websafeInt(n)
returns the integer nearest the value that be used in the short HTML representation (like in #fff)
Parameters:
{Integer} n
Returns:
{Integer}

Documentation generated by JsDoc Toolkit 2.3.0

Khromaxul - version: 0.3alpha - Thu Jul 30 2009 14:37:38 GMT+0200 (CEST)