Show:

CGSGNodeColorPicker Class

A color Picker

Constructor

CGSGNodeColorPicker
(
  • x
  • y
)
Parameters:

Methods

_initShape () private

Pre-render the node into a temp canvas to optimize the perfs

_onClickHandler
(
  • event
)
private
Parameters:
  • event Event
_onMouseOverHandler
(
  • event
)
private
Parameters:
  • event Event
getColorAt
(
  • absolutePosition
)
Object
Parameters:
  • absolutePosition CGSGPosition

    position of the cursor inside the colorPicker

Returns:
Object: Object with {r:x, g:x, b:x} value
render
(
  • context
)
protected

Custom rendering. Must be defined to allow the traverser to render this node

Parameters:
  • context CanvasRenderingContext2D

    the context into render the node

resizeBy
(
  • w
  • h
)

Override the parent method.

Parameters:
resizeTo
(
  • x
  • y
)

Override the parent method.

Parameters:
resizeWith
(
  • w
  • h
)

Override the parent method.

Parameters:

Properties

_imgData ImageData private
onClickColor Function

Event fired when the user click on the color picker. Return a {r, g, b} Object.

Default: null

onOverColor Function

Event fired when the mice cursor move over the color picker. Return a {r, g, b} Object.

Default: null