logo

/Color Picker|v2.2.4

Class

new ColorPicker(options)factory.jsline 30

PARAMETERS
NameTypeDescription

options

object

options for colorpicker component

PROPERTIES
NameTypeDescription

container

HTMLDivElement

container element

color

string = '#ffffff'

default selected color

preset

[ Array ]

color preset for palette (use base16 palette if not supplied)

cssPrefix

string = 'tui-colorpicker-'

css prefix text for each child elements

detailTxt

string = 'Detail'

text for detail button.

usageStatistics

boolean = true

Let us know the hostname. If you don't want to send the hostname, please set to false.

EXAMPLES
var colorPicker = tui.colorPicker; // or require('tui-color-picker')

var instance = colorPicker.create({
  container: document.getElementById('color-picker')
});

Instance Methods

destroy()factory.jsline 245

Destroy colorpicker instance.

EXAMPLES
instance.destroy(); // DOM-element is removed

getColor()factory.jsline 215

Get hex color string of current selected color in colorpicker instance.

RETURNS:
{

string

} - hex string formatted color
EXAMPLES
instance.setColor('#ffff00');
instance.getColor(); // '#ffff00';

setColor(hexStr)factory.jsline 199

Set color to colorpicker instance.
The string parameter must be hex color value

PARAMETERS
NameTypeDescription

hexStr

string

hex formatted color string

EXAMPLES
instance.setColor('#ffff00');

toggle(isShow)factory.jsline 227

Toggle colorpicker element. set true then reveal colorpicker view.

PARAMETERS
NameTypeDescription

isShow

boolean = false

A flag to show

EXAMPLES
instance.toggle(false); // hide
instance.toggle(); // hide
instance.toggle(true); // show

Events

selectColorfactory.jsline 137

PROPERTIES
NameTypeDescription

color

string

selected color (hex string)

origin

string

flags for represent the source of event fires.

Resizable