Visit Mozilla.org

XUL:colorpicker

From MDC

« XUL Reference home    [ Examples | Attributes | Properties | Methods | Related ]

A palette of colors from which a user may select by clicking on one of the grid cells.

Attributes
disabled, color, onchange, preference, tabindex, type
Properties
accessibleType, color, disabled, open, tabIndex, value

[edit] Examples

Image:XUL_REF_rgb.gif

<colorpicker type="button"/>

[edit] Attributes

Inherited from XUL element
align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width

disabled
Type: boolean
Indicates whether the element is disabled or not. If this element is set to true the element is disabled. Disabled elements are usually drawn with grayed-out text. If the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.

color
Type: color string
The currently selected color. This is modified when the user selects a color. You can assign a string of the form #RRGGBB to this property to change the selected color.

onchange
Type: script code
The code in the onchange attribute is called when the value of the element is changed.

preference
Type: element id
Connects the element to a corresponding preference. This attribute only has any effect when used inside a prefwindow. The value of the preference will be updated to match the value property of the element.

tabindex
Type: integer
The tab order of the element. The tab order is the order in which the focus is moved when the user presses the "tab" key. Elements with a higher tabindex are later in the tab sequence.

type
Type: string
If this attribute is not present, the colorpicker is displayed inside the window. If this is set to the text button, the colorpicker is displayed as a button. When the user clicks the button, a popup appears for the user to select a color.


[edit] Properties

Inherited from XUL element
align, allowEvents, boxObject, builder, className, collapsed, contextMenu, controllers, currentItem, database, datasources, dir, flex, height, hidden, id, left, listBoxObject, maxHeight, maxWidth, menu, minHeight, minWidth, observes, ordinal, orient, pack, persist, ref, resource, statusText, style, tooltip, tooltipText, top, value, width

Inherited from DOM element
attributes, childNodes, cloneNode, firstChild, lastChild, localName, namespaceURI, nextSibling, nodeName, nodeType, nodeValue, ownerDocument, parentNode, prefix, previousSibling, tagName

accessibleType
Type: integer
A value indicating the type of accessibility object for the element.

color
Type: color string
The currently selected color. This is modified when the user selects a color. You can assign a string of the form #RRGGBB to this property to change the selected color.

disabled
Type: boolean
Gets and sets the value of the disabled attribute.

open
Type: boolean
Returns true if the popup for a button-type colorpicker is open. Set this property to true to open the popup or false to close the popup.

tabIndex
Type: integer
Gets and sets the value of the tabindex attribute.

value
Type: string
Gets and sets the value of the value attribute.

[edit] Methods

Inherited from XUL element
blur, click, doCommand, focus, getElementsByAttribute

Inherited from DOM element
addEventListener, appendChild, dispatchEvent, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, hasAttribute, hasAttributeNS, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeAttribute, removeAttributeNode, removeAttributeNS, removeChild, removeEventListener, replaceChild, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS

[edit] Related

Interfaces
nsIDOMXULControlElement