joliclic

home

kh-xypicker

« Index [ Examples | Attributes | Properties | Methods ]

a 2D picker, (x, y) = (0, 0) means the top left corner, (1, 1) means the bottom right corner.

default dimensions: width="150" height="150"

a change event is dispatched when x or y properties changed.

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
x, y, type, h, s, v, r, g, b
Properties
x, y, h, s, v, r, g, b
Methods
setXY, setH, setS, setV, setSV, setHV, setHS, setR, setG, setB, setGB, setRB, setRG

Examples

example screenshot
<kh-xypicker x="0.8" y="0.3"/>
example screenshot
<kh-xypicker type="hv" h="200" s="60" v="35"/>
example screenshot
<kh-xypicker type="gb" r="200" g="60" b="35"/>

live examples:


Attributes

x

type: integer

initial horizontal coordinate, in [O, 1] default = 1

y

type: integer

initial vertical coordinate, in [O, 1] default = 1

type

type: one of these values

create specialized and colored 2D pickers, used by the kh-rgbpicker and kh-hsvpicker elements.

h

only for type "sv", "hv", and "hs"

type: integer

The initial hue of the color, in [0, 360] (default = 0). For type "sv", this changes the background, for type "hv" this changes the y coordinate, for type "hs" this change the x coordinate.

s

only for type "sv", "hv", and "hs"

type: integer

The initial saturation of the color, in [0, 100] (default = 100). For type "hv", this changes the background, for type "sv" this changes the y coordinate, for type "hs" this change the x coordinate.

v

only for type "sv", "hv", and "hs"

type: integer

The initial value of the color, in [0, 100]. For type "hs", this changes the background, for type "sv" and "hv" this change the x coordinate.

r

only for type "gb", "rg", and "rb"

type: integer

The initial red of the color, in [0, 255] (default = 255). For type "gb", this changes the background, for type "rg" and "rb" this changes the y coordinate.

g

only for type "gb", "rg", and "rb"

type: integer

The initial green of the color, in [0, 255] (default = 255). For type "rb", this changes the background, for type "rg" this changes the x coordinate, for type "gb" this changes the y coordinate.

b

only for type "gb", "rg", and "rb"

type: integer

The initial blue of the color, in [0, 255] (default = 255). For type "rg", this changes the background, for type "gb" and "rb" this changes the x coordinate.

Properties

x

type: integer

Get and set the horizontal coordinate, in [0, 1]

y

type: integer

Get and set the horizontal coordinate, in [0, 1]

h

only for type "sv", "hv", and "hs"

type: integer

Get and set the hue of the color in [0, 360]. For type "sv", this changes the background, for type "hv" this changes the y coordinate, for type "hs" this change the x coordinate.

s

only for type "sv", "hv", and "hs"

type: integer

Get and set the saturation of the color in [0, 100]. For type "hv", this changes the background, for type "sv" this changes the y coordinate, for type "hs" this change the x coordinate.

v

only for type "sv", "hv", and "hs"

type: integer

Get and set the value of the color in [0, 100]. For type "hs", this changes the background, for type "sv" and "hv" this change the x coordinate.

r

only for type "gb", "rg", and "rb"

type: integer

Get and set the red of the color in [0, 255]. For type "gb", this changes the background, for type "rg" and "rb" this changes the y coordinate.

g

only for type "gb", "rg", and "rb"

type: integer

Get and set the green of the color in [0, 255]. For type "rb", this changes the background, for type "rg" this changes the x coordinate, for type "gb" this changes the y coordinate.

b

only for type "gb", "rg", and "rb"

type: integer

Get and set the blue of the color in [0, 255]. For type "rg", this changes the background, for type "gb" and "rb" this changes the x coordinate.

Methods

void setXY(integer x, integer y, optional boolean silent)

Set the horizontal and vertical coordinates.

x and y must be in [0, 1], otherwise they're will be restricted to.

If the optional argument "silent" is passed as true, no change event will be dispatched.

void setH(integer h, optional boolean silent)

only for type "sv", "hv", and "hs"

Set the h property. The optional argument "silent" is available only for type "hv" and "hs", if it's passed as true, no change event will be dispatched.

void setS(integer s, optional boolean silent)

only for type "sv", "hv", and "hs"

Set the s property. The optional argument "silent" is available only for type "sv" and "hs", if it's passed as true, no change event will be dispatched.

void setV(integer v, optional boolean silent)

only for type "sv", "hv", and "hs"

Set the v property. The optional argument "silent" is available only for type "hv" and "sv", if it's passed as true, no change event will be dispatched.

void setSV(integer s, integer v, optional boolean silent)

only for type "sv"

Set the s and v properties. If the optional argument "silent" is passed as true, no change event will be dispatched.

void setHV(integer h, integer v, optional boolean silent)

only for type "hv"

Set the h and v properties. If the optional argument "silent" is passed as true, no change event will be dispatched.

void setHS(integer h, integer s, optional boolean silent)

only for type "hs"

Set the h and s properties. If the optional argument "silent" is passed as true, no change event will be dispatched.

void setR(integer r, optional boolean silent)

only for type "gb", "rb", and "rg"

Set the r property. The optional argument "silent" is available only for type "rg" and "rb", if it's passed as true, no change event will be dispatched.

void setG(integer g, optional boolean silent)

only for type "gb", "rb", and "rg"

Set the g property. The optional argument "silent" is available only for type "gb" and "rg", if it's passed as true, no change event will be dispatched.

void setB(integer b, optional boolean silent)

only for type "gb", "rb", and "rg"

Set the b property. The optional argument "silent" is available only for type "gb" and "rb", if it's passed as true, no change event will be dispatched.

void setGB(integer g, integer b, optional boolean silent)

only for type "gb"

Set the g and b properties. If the optional argument "silent" is passed as true, no change event will be dispatched.

void setRB(integer r, integer b, optional boolean silent)

only for type "rb"

Set the r and b properties. If the optional argument "silent" is passed as true, no change event will be dispatched.

void setRG(integer r, integer g, optional boolean silent)

only for type "rg"

Set the r and g properties. If the optional argument "silent" is passed as true, no change event will be dispatched.

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