Class: $.ColorWheel

Inherits:
WatchUi.Drawable show all

Overview

Draws a color wheel for the color picker

Constant Summary

Constant Variables

Type Name Value Since Description
Type NUM_POINTS 30

Instance Member Summary collapse

Instance Method Summary collapse

Instance Attribute Details

var _colors as Lang.Array<Graphics.ColorType>

var _index as Lang.Number

Instance Method Details

draw(dc as Graphics.Dc) as Void

Draw an object to device context

Parameters:

  • dc —

    Device context

drawArc(dc as Graphics.Dc, centerX as Lang.Number, centerY as Lang.Number, startAngle as Lang.Float, endAngle as Lang.Float, fill as Lang.Boolean) as Void

Draw an arc that is a section of the color wheel

Parameters:

  • dc —

    Device context

  • centerX —

    Center of the wheel, x coordinate

  • centerY —

    Center of the wheel, y coordinate

  • startAngle —

    Angle for the start of the arc

  • endAngle —

    Angle for the end of the arc

  • fill —

    Whether to fill the section drawn

getColor(index as Lang.Number) as Graphics.ColorType

Get the color of the item at the given index

Parameters:

  • index —

    Index of the item to get the color of

Returns:

  • Color of the item

getColorIndex(color as Graphics.ColorType) as Lang.Number

Get the index of a color

Parameters:

  • color —

    The color to get the index of

Returns:

  • The index of the color

getNumberOfColors() as Lang.Number

Get the number of colors in the wheel

Returns:

  • Number of colors

initialize(colors as Lang.Array<Graphics.ColorType>)

Constructor

Parameters:

  • colors —

    The colors to put on the color wheel

setColor(index as Lang.Number) as Void

Set the current color index

Parameters:

  • index —

    Current color index


Generated Oct 20, 2026, 8:20:54 AM