|
TachyonUI 1.1.0
High-performance UI for building tools.
|
Persistent state of the color picker popup. More...
#include <gui_controls/subsystems/gui_color_picker_subsystem.h>
Classes | |
| struct | HSVA |
| The working color as HSV+A, the part a press on the square or a strip changes. More... | |
| struct | PaletteSwatch |
Public Types | |
| enum class | CloseRequest { None , Ok , Cancel } |
| OK keeps the color (and adds it to the recent ones), Cancel and the close button restore the one the picker opened with. More... | |
| enum class | DragTarget { None , Square , Hue , Alpha } |
| What a press on the square or a strip changes. More... | |
Public Attributes | |
| tachyon::ID | triggerID = tachyon::ID::Invalid() |
| swatch that opened the picker | |
| tachyon::ID | windowID = tachyon::ID::Invalid() |
| popup window ID | |
| float | h = 0 |
| float | s = 0 |
| float | v = 0 |
| float | a = 1 |
| working HSV+A copy | |
| float | spaceHue = 0 |
| The hue in the active space (HSL's, Lab's or Oklab's angle), 0-1. | |
| tachyon::color4f | originalColor {} |
| color when picker was opened | |
| bool | allowHDR = false |
| the opening field accepts HDR colors | |
| float | hdrBrightness = 1.0f |
| HDR multiplier; > 1 brightens past 1. | |
| std::string | hexText |
| hex input field text | |
| tachyon::ColorSpace | activeSpace = tachyon::ColorSpace::HSV |
| float | comp [3] = { 0, 0, 0 } |
| Components of the active space (H/S/V, R/G/B, L/a/b, ...). | |
| float | snapComp [3] = { 0, 0, 0 } |
| comp as last built; a difference next frame means a slider edited it. | |
| bool | slidersInitialized = false |
| bool | byteRange = true |
| Channel values shown 0-255 (and hue in degrees, S/V/L in percent), or 0-1. | |
| bool | picking = false |
| The eyedropper is held: the color follows the screen under the cursor. | |
| std::optional< bool > | canPick |
| whether the platform reads the screen (asked once) | |
| std::string | context |
| what's being edited (the field's label), after the title | |
| enum tachyon::ColorPickerState::CloseRequest | closeRequest = CloseRequest::None |
| std::vector< tachyon::color4f > | recent |
| newest first | |
| tachyon::VisualColorStyleIndex | svQuadColor = tachyon::VisualColorStyleIndex::Invalid |
| tachyon::VisualColorStyleIndex | hueStrip = tachyon::VisualColorStyleIndex::Invalid |
| tachyon::VisualColorStyleIndex | alphaStrip = tachyon::VisualColorStyleIndex::Invalid |
| tachyon::VisualColorStyleIndex | hueColor = tachyon::VisualColorStyleIndex::Invalid |
| The pure hue, shown in the hue handle. | |
| tachyon::VisualColorStyleIndex | whiteColor = tachyon::VisualColorStyleIndex::Invalid |
| tachyon::VisualColorStyleIndex | outlineColor = tachyon::VisualColorStyleIndex::Invalid |
| Outline around the cursors and handles. | |
| tachyon::VisualColorStyleIndex | newColor = tachyon::VisualColorStyleIndex::Invalid |
| The new color, with its alpha. | |
| tachyon::VisualColorStyleIndex | originalStyle = tachyon::VisualColorStyleIndex::Invalid |
| tachyon::Gesture< HSVA > | press |
| The press on the square or a strip, a drag from the start; the color before it is put back by Escape. | |
| tachyon::VisualColorStyleIndex | gradientStyles [kNumGradientSliders] = {} |
| std::vector< PaletteSwatch > | palette |
| The design's palette: red, orange, amber, green, teal (half clear), blue, sky, violet (half clear), pink, white, black, black (half clear). | |
Static Public Attributes | |
| static constexpr int | kNumGradientSliders = 4 |
Persistent state of the color picker popup.
The picker opens off a ColorField swatch (triggerID), edits a working copy, and writes the result back to the caller's color. It lives across frames so the popup keeps its tab, palette and drag state while the popup is rebuilt each frame.
|
strong |
|
strong |
| tachyon::ID tachyon::ColorPickerState::triggerID = tachyon::ID::Invalid() |
swatch that opened the picker
| tachyon::ID tachyon::ColorPickerState::windowID = tachyon::ID::Invalid() |
popup window ID
| float tachyon::ColorPickerState::h = 0 |
| float tachyon::ColorPickerState::s = 0 |
| float tachyon::ColorPickerState::v = 0 |
| float tachyon::ColorPickerState::a = 1 |
working HSV+A copy
| float tachyon::ColorPickerState::spaceHue = 0 |
The hue in the active space (HSL's, Lab's or Oklab's angle), 0-1.
Kept apart: a grey has none, and the strip and square still need one to work with.
| tachyon::color4f tachyon::ColorPickerState::originalColor {} |
color when picker was opened
| bool tachyon::ColorPickerState::allowHDR = false |
the opening field accepts HDR colors
| float tachyon::ColorPickerState::hdrBrightness = 1.0f |
HDR multiplier; > 1 brightens past 1.
| std::string tachyon::ColorPickerState::hexText |
hex input field text
| tachyon::ColorSpace tachyon::ColorPickerState::activeSpace = tachyon::ColorSpace::HSV |
| float tachyon::ColorPickerState::comp[3] = { 0, 0, 0 } |
Components of the active space (H/S/V, R/G/B, L/a/b, ...).
Members, since the channel tracks' handlers keep pointers to them until dispatch.
| float tachyon::ColorPickerState::snapComp[3] = { 0, 0, 0 } |
comp as last built; a difference next frame means a slider edited it.
| bool tachyon::ColorPickerState::slidersInitialized = false |
| bool tachyon::ColorPickerState::byteRange = true |
Channel values shown 0-255 (and hue in degrees, S/V/L in percent), or 0-1.
| bool tachyon::ColorPickerState::picking = false |
The eyedropper is held: the color follows the screen under the cursor.
| std::optional<bool> tachyon::ColorPickerState::canPick |
whether the platform reads the screen (asked once)
| std::string tachyon::ColorPickerState::context |
what's being edited (the field's label), after the title
| enum tachyon::ColorPickerState::CloseRequest tachyon::ColorPickerState::closeRequest = CloseRequest::None |
| std::vector<tachyon::color4f> tachyon::ColorPickerState::recent |
newest first
| tachyon::VisualColorStyleIndex tachyon::ColorPickerState::svQuadColor = tachyon::VisualColorStyleIndex::Invalid |
| tachyon::VisualColorStyleIndex tachyon::ColorPickerState::hueStrip = tachyon::VisualColorStyleIndex::Invalid |
| tachyon::VisualColorStyleIndex tachyon::ColorPickerState::alphaStrip = tachyon::VisualColorStyleIndex::Invalid |
| tachyon::VisualColorStyleIndex tachyon::ColorPickerState::hueColor = tachyon::VisualColorStyleIndex::Invalid |
The pure hue, shown in the hue handle.
| tachyon::VisualColorStyleIndex tachyon::ColorPickerState::whiteColor = tachyon::VisualColorStyleIndex::Invalid |
| tachyon::VisualColorStyleIndex tachyon::ColorPickerState::outlineColor = tachyon::VisualColorStyleIndex::Invalid |
Outline around the cursors and handles.
| tachyon::VisualColorStyleIndex tachyon::ColorPickerState::newColor = tachyon::VisualColorStyleIndex::Invalid |
The new color, with its alpha.
| tachyon::VisualColorStyleIndex tachyon::ColorPickerState::originalStyle = tachyon::VisualColorStyleIndex::Invalid |
| tachyon::Gesture<HSVA> tachyon::ColorPickerState::press |
The press on the square or a strip, a drag from the start; the color before it is put back by Escape.
|
staticconstexpr |
| tachyon::VisualColorStyleIndex tachyon::ColorPickerState::gradientStyles[kNumGradientSliders] = {} |
| std::vector<PaletteSwatch> tachyon::ColorPickerState::palette |
The design's palette: red, orange, amber, green, teal (half clear), blue, sky, violet (half clear), pink, white, black, black (half clear).