PERGOLA LOGO

pergola.ColorPicker

System events: YES.

User events and functions: NO (callback function is defined by user and invoked by the OK button of the color picker panel).

Example.

Listed: class properties/methods; prototype properties and methods; instance properties. Prototype properties and methods inherited by the Class superclass are not listed.

Note: only the init() method can be invoked explicitly.

class

None

prototype

PROPERTIES

parent

pergola.Panel instance container. Must not be overridden.

spectrum

Defined in pergola.presentationAttributes – string ("narrow", "wide"). Determines the initial display type.

width

256 – number (user space units). Do not override.

height

256 – number (user space units). Do not override.

maxX

255 – number.

max

255 – number. Constant. Do not override.

mult

6 – number. Do not override.

region

[0, 85, 170] – array. Relates to narrow spectrum.

METHODS

release()

This method is invoked upon release of pergola.dragarea. You never need to invoke this method explicitly.

spectrumIinitDrag(evt)

Returns an activation object for pergola.dragarea. You never need to invoke this method explicitly.

spectrumScan(evt)

Callback for pergola.dragarea. Invokes setDrop. You never need to invoke this method explicitly.

setDrop()

You never need to invoke this method explicitly.

brightnessIinitDrag(evt)

Returns an activation object for pergola.dragarea. You never need to invoke this method explicitly.

brightnessScan(evt)

Callback for pergola.dragarea. Invokes setBrightness. You never need to invoke this method explicitly.

setBrightness()

You never need to invoke this method explicitly.

setByHex(v)

You never need to invoke this method explicitly.

set()

You never need to invoke this method explicitly.

valuesDisplay(r, g, b)

You never need to invoke this method explicitly.

valueFromBrightness(n)

You never need to invoke this method explicitly.

hueFromValues(rgb)

You never need to invoke this method explicitly.

toHex(n)

n is a number or string representing a r, g, or b color value. Returns the hexadecimal string representation of n.

toRGB(c)

c is a hexadecimal color string without the “#” sign. Returns an array with r, g, b number color values.

absoluteX(node)

Returns the CTM.e of node.

absoluteY(node)

Returns the CTM.f of node.

layout_narrow()

Switches to basic mode (65536 visible colors).

layout_wide()

Switches to extended mode (393216 visible colors).

init(object)

object must specify the user object. If object specifies color (color string in any legal format) it determines the initial color value, otherwise "#FFFFFF" is used.

handleEvent(evt)

build()

Creates elements. Returns this. Note: this method does not expect an initialization object.

instance

name

String. If not passed to the constructor, gets a generated XML name (Class).

id

String. The return value of this name.toXML(). This container ID. Used as prefix where other elements' IDs are attributed.

owner

pergola.Panel instance. Do not override.

user

Must be specified in the initialization object; the current user object.

color

If specified, color string in any legal format; the initial color value.

RGB

 {
    r : initial value,
    g : initial value,
    b : initial value
  }

container

<g> element.

spectrumMask

<rect> element.

drop

 { container : <g> element }

brightnessMask

<stop> (gradient) element.

needle

 {
    x : 0,
    y : 0,
    container : <g> element.
  }

brightnessBar

<rect> element.

sample

<rect> element.

newSample

<rect> element.

input

 {
    r : pergola.Input instance,
    g : pergola.Input instance,
    b : pergola.Input instance,
    hex : pergola.Input instance
  }