joliclic

home

kh-rgbpicker

« Index [ Examples | Attributes | Properties | Methods ]

An color selector, in the RGB color space.

Note: The color rendering don't intend to have a pixel precision, but it is exact globally. This is due to the technics used, some layered SVG.

Attributes
r, g, b, type, xypickerwidth, xypickerheight, scalewidth, scaleheight
Properties
r, g, b, FLAGS
Methods
setRGB, setR, setG, setB, setGB, setRB, setRG

Examples

example screenshot
<kh-rgbpicker type="r-gb"/>
example screenshot
<kh-rgbpicker type="g-rb"/>
example screenshot
<kh-rgbpicker type="b-rg"/>

live examples:


Attributes

r

type: integer

The initial value of the red of the color (in [0, 255]). Default = 255

If you want to get or set the red value later, use the "r" property instead.

g

type: integer

The initial value of the green of the color (in [0, 255]). Default = 255

If you want to get or set the green value later, use the "g" property instead.

b

type: integer

The initial value of the blue of the color (in [0, 255]). Default = 255

If you want to get or set the blue value later, use the "b" property instead.

type

type: one of these values

xypickerwidth

type: integer

The width in pixel of the kh-xypicker. Default = 156

xypickerheight

type: integer

The height in pixel of the kh-xypicker. Default = 156

scalewidth

type: integer

The width in pixel of the vertical scale. Default = 22

scaleheight

type: integer

The height in pixel of the vertical scale. Default = 156

Properties

r

type: integer

Get and set the red value of the selected color, in [O, 255]

g

type: integer

Get and set the green value of the selected color, in [O, 255]

b

type: integer

Get and set the blue value of the selected color, in [O, 255]

FLAGS

readonly (constants)

type: integer

these flags are used when change events are fired by the element, event.detail may contain one of this value:

Methods

void setRGB(int r, int g, int b, optional boolean silently)

Set the r, g, b properties. If the parameter silently is set as true, no change event will be dispatched.

void setR(int r, optional boolean silently)

Set the r property. If the parameter silently is set as true, no change event will be dispatched.

void setG(int g, optional boolean silently)

Set the g property. If the parameter silently is set as true, no change event will be dispatched.

void setB(int b, optional boolean silently)

Set the b property. If the parameter silently is set as true, no change event will be dispatched.

void setGB(int g, int b, optional boolean silently)

Only available for type "r-gb"

Set the g and b properties. If the parameter silently is set as true, no change event will be dispatched.

void setRB(int r, int b, optional boolean silently)

Only available for type "g-rb"

Set the r and b properties. If the parameter silently is set as true, no change event will be dispatched.

void setRG(int r, int g, optional boolean silently)

Only available for type "b-rg"

Set the r and g properties. If the parameter silently is set as true, no change event will be dispatched.

Khromaxul - version: 0.3alpha - 2009-07-30