joliclic

home

kh-scale

« Index [ Examples | Attributes | Properties | Methods ]

Similar to a xul:scale, but with a colored background, wich can be a gradient. Scroll events are handled to change the value.

All attributes, properties and methods of a xul:scale are inherited.

To specify the dimensions, the usual width and height attributes are used when construct, and the colored zone and the thumb are adapted. Note that if this element is stretched when displayed, the scale appears on top left of the used space, so use the pack or align attribute on its parent if it is necessary.

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
colors
Properties
colors
Methods
getColors, setColors

Examples

example screenshot
<kh-scale width="170" height="24"
          colors="rgb(255, 0, 0);blue"/>
example screenshot
<kh-scale width="170" height="24"
          colors="rgb(255, 10, 0);blue; white; #FF0"/>

live examples:


Attributes

colors

type: string

The initial colors of the background. List of valid SVG colors, separated by the character ";". Any valid SVG color can be used (#rgb, #rrggbb, rgb(r, g, b), SVG name). A linear gradient will be applied between each colors. Default = "#fff;#fff".

To change later these colors, use the colors property, or the setColors() method.

Properties

colors

type: string

Get and set the colors of the background. List of valid SVG colors separated by the character ";". A linear gradient will be applied between each colors.

Methods

string getColors()

Get the colors of the background, a list of SVG colors separated by the ";" character.

void setColors(string colors)

Set the colors of the background. You must pass a list of SVG colors separated by the ";" character. A gradient will be applied between each colors.

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