guillaume 2026.6.1
A C++ UI framework designed for modern desktop and extended reality (XR) applications.
Loading...
Searching...
No Matches
guillaume::systems::style Namespace Reference

Color helpers shared by the widget systems. More...

Functions

utility::graphic::Color32Bit withAlpha (const utility::graphic::Color32Bit &color, std::uint8_t alpha)
 Copy a color with another alpha channel.
utility::graphic::Color32Bit stateLayer (const utility::graphic::Color32Bit &base, const utility::graphic::Color32Bit &overlay, std::uint8_t alpha)
 Blend a translucent tint over a base color.
utility::graphic::Color32Bit schemeColor (SchemeColorRole role)
 Look up a color role in the color scheme of the active theme.
utility::graphic::Color32Bit stateLayer (const utility::graphic::Color32Bit &base, const utility::graphic::Color32Bit &overlay, theme::StateLayer layer)
 Blend a tint over a base color at the opacity the active theme gives to an interaction state.
utility::graphic::Color32Bit disabledContentColor (void)
 Color of the icon, label or outline of a disabled widget.
utility::graphic::Color32Bit disabledContainerColor (void)
 Fill color of the container of a disabled widget.
utility::graphic::Color32Bit transparentColor (void)
 The color written to hide a fill or an outline without removing its component.

Detailed Description

Color helpers shared by the widget systems.

See also
guillaume::systems::interaction, guillaume::systems::placement

Function Documentation

◆ disabledContainerColor()

utility::graphic::Color32Bit guillaume::systems::style::disabledContainerColor ( void )
inline

Fill color of the container of a disabled widget.

Returns
The OnSurface color of the active scheme at the theme::StateLayer::DisabledContainer opacity (12% in Material 3).

Definition at line 143 of file style_helpers.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ disabledContentColor()

utility::graphic::Color32Bit guillaume::systems::style::disabledContentColor ( void )
inline

Color of the icon, label or outline of a disabled widget.

Returns
The OnSurface color of the active scheme at the theme::StateLayer::DisabledContent opacity (38% in Material 3).

Definition at line 131 of file style_helpers.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ schemeColor()

utility::graphic::Color32Bit guillaume::systems::style::schemeColor ( SchemeColorRole role)
inline

Look up a color role in the color scheme of the active theme.

Parameters
roleThe role to resolve, for example SchemeColorRole::Primary.
Returns
The color the active theme assigns to that role.
See also
guillaume::getActiveColor

Definition at line 96 of file style_helpers.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stateLayer() [1/2]

utility::graphic::Color32Bit guillaume::systems::style::stateLayer ( const utility::graphic::Color32Bit & base,
const utility::graphic::Color32Bit & overlay,
std::uint8_t alpha )
inline

Blend a translucent tint over a base color.

This is how a hover, focus or press is shown: the content color is laid over the container color at a low opacity.

Parameters
baseThe color underneath, usually the container color.
overlayThe tint, usually the content color. Its own alpha is ignored and replaced by alpha.
alphaThe opacity of the tint, 0 (no tint) to 255 (opaque).
Returns
The blended color.

Definition at line 83 of file style_helpers.hpp.

Here is the caller graph for this function:

◆ stateLayer() [2/2]

utility::graphic::Color32Bit guillaume::systems::style::stateLayer ( const utility::graphic::Color32Bit & base,
const utility::graphic::Color32Bit & overlay,
theme::StateLayer layer )
inline

Blend a tint over a base color at the opacity the active theme gives to an interaction state.

// Container color of a hovered filled button.
const auto color = style::stateLayer(
style::schemeColor(SchemeColorRole::Primary),
style::schemeColor(SchemeColorRole::OnPrimary),
utility::graphic::Color32Bit stateLayer(const utility::graphic::Color32Bit &base, const utility::graphic::Color32Bit &overlay, std::uint8_t alpha)
Blend a translucent tint over a base color.
utility::graphic::Color32Bit schemeColor(SchemeColorRole role)
Look up a color role in the color scheme of the active theme.
@ Hovered
0.08 overlay of the content color.
Definition tokens.hpp:224
Parameters
baseThe color underneath, usually the container color.
overlayThe tint, usually the content color.
layerThe interaction state (Hovered, Focused, Pressed, ...) whose opacity is read from the active theme.
Returns
The blended color.

Definition at line 119 of file style_helpers.hpp.

Here is the call graph for this function:

◆ transparentColor()

utility::graphic::Color32Bit guillaume::systems::style::transparentColor ( void )
inline

The color written to hide a fill or an outline without removing its component.

Returns
Black with an alpha of 0.

Definition at line 155 of file style_helpers.hpp.

Here is the caller graph for this function:

◆ withAlpha()

utility::graphic::Color32Bit guillaume::systems::style::withAlpha ( const utility::graphic::Color32Bit & color,
std::uint8_t alpha )
inline

Copy a color with another alpha channel.

Parameters
colorThe color whose red, green and blue channels are kept.
alphaThe alpha of the result, 0 (transparent) to 255 (opaque). It replaces the alpha of color; the two are not multiplied.
Returns
The same color with the given alpha.

Definition at line 65 of file style_helpers.hpp.

Here is the caller graph for this function: