ASP.NET Color Picker Documentation - Client side interface

Methods of client-side Color Picker object

Name Description
methodgetColor() Returns the selected color as a string in #RRGGBB format.

See Working example.

var pickedColor = obj.getColor();
methodgetHorizontalPosition() Returns the current horizontal position of picker's popup as a string.
The returned value can be one of the following: LEFT, CENTER, RIGHT.

var hPosition = obj.getHorizontalPosition();
methodgetOffsetLeft() Returns additional left offset of picker's popup according to its position as an integer.

var leftOffset = obj.getOffsetLeft();
methodgetOffsetTop() Returns additional top offset of picker's popup according to its position as an integer.

var topOffset = obj.getOffsetTop();
methodgetPickerElement() Returns the node of picker's caller element.

See Working example.

var pickerCaller = obj.getPickerElement();
methodgetTargetElement() Returns the node of target element (null if target element was not set).

var target = obj.getTargetElement();
methodgetVerticalPosition() Returns the current vertical position of picker's popup as a string.
The returned value can be one of the following: TOP, MIDDLE, BOTTOM.

var vPosition = obj.getVerticalPosition();
methodsetColor(color) Set initial color in popup to color.
Initial color should be a string in #RRGGBB format.
Returns the color was set.

See Working example.

obj.setColor("#FF00FF");
methodsetHorizontalPosition(hpos) Set horizontal position of picker's popup to hvos.
Horizontal position should be a string with one of the following values: Left, Center, Right. This parameter is case insensitive.
Returns the horizontal position was set.

See Working example.

obj.setHorizontalPosition("LEFT");
methodsetOffsetLeft(offset) Set additional left offset of picker's popup according to its position.
Offset should be an integer value (positive or negative).
Returns the left offset was set.

See Working example.

obj.setOffsetLeft(-10);
methodsetOffsetTop(offset) Set additional top offset of picker's popup according to its position.
Offset should be an integer value (positive or negative).
Returns the top offset was set.

See Working example.

obj.setOffsetTop(5);
methodsetTargetClientID(Id) Set Id of target element.
Returns the node of target element (null if Id was not found).

obj.setTargetClientID("myInput");
methodsetVerticalPosition(vpos) Set vertical position of picker's popup to pvos.
Vertival position should be a string with one of the following values: Top, Middle, Bottom. This parameter is case insensitive.
Returns the vertical position was set.

See Working example.

obj.setVerticalPosition("TOP");

Static functions

Name Description
methodOboutInc.ColorPicker.getStyle(elem,strCssRule) Returns value of strCssRule css rule for elem HTML element.

var myBorderLeftWidth = OboutInc.ColorPicker.getStyle(myElement,"border-left-width");

See Working example.