ColorSwatchGroup

Package: Libraries.Interface.Controls · Inherits from: Libraries.Interface.Item, Libraries.Interface.Controls.Control, Libraries.Interface.Item2D, Libraries.Interface.Controls.ButtonGroup, Libraries.Language.Object

A ColorSwatchGroup is the ButtonGroup that holds a ColorPicker's swatches. The keyboard focus stays on the group while the arrow keys choose swatches, so the group points screen readers at the chosen swatch (GetActiveDescendant), and they read its color, such as "#FF0000, red", as it changes.

Example Code

use Libraries.Game.Graphics.Color
use Libraries.Interface.Controls.ColorSwatch
use Libraries.Interface.Controls.ColorSwatchGroup

Color color
ColorSwatchGroup group
group:SetName("Swatches")
ColorSwatch red
red:SetColor(color:Red())
group:AddToGrouping(red)
group:Add(red)

Actions

GetActiveDescendant()

This action returns the chosen swatch, which screen readers are pointed at while the group has the focus, or undefined when no swatch is chosen.

Returns

Libraries.Interface.Item: The chosen swatch, or undefined.

Example

use Libraries.Interface.Controls.ColorSwatchGroup
use Libraries.Interface.Item
ColorSwatchGroup group
Item active = group:GetActiveDescendant()

Inherited Actions

13 actions from Libraries.Interface.Controls.ButtonGroup
263 actions from Libraries.Interface.Controls.Control
60 actions from Libraries.Interface.Item
201 actions from Libraries.Interface.Item2D
3 actions from Libraries.Language.Object