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

The opacity of each StateLayer, 0 to 1. More...

#include <headers/guillaume/theme/tokens.hpp>

Public Member Functions

 StateLayerScale (void)
 Create the scale with the Material 3 baseline opacities.
float getOpacity (StateLayer layer) const
 Get the opacity of a state layer.
std::uint8_t getAlpha (StateLayer layer) const
 Get the opacity of a state layer as an alpha channel value.
void setOpacity (StateLayer layer, float opacity)
 Replace the opacity of a state layer.

Detailed Description

The opacity of each StateLayer, 0 to 1.

The defaults are the Material 3 values listed in StateLayer. Read them through guillaume::getStateLayerAlpha, which returns the opacity as an alpha channel value ready to put in a color.

See also
guillaume::Theme::getStateLayers

Definition at line 242 of file tokens.hpp.

Constructor & Destructor Documentation

◆ StateLayerScale()

guillaume::theme::StateLayerScale::StateLayerScale ( void )

Create the scale with the Material 3 baseline opacities.

Definition at line 101 of file tokens.cpp.

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

Member Function Documentation

◆ getAlpha()

std::uint8_t guillaume::theme::StateLayerScale::getAlpha ( StateLayer layer) const

Get the opacity of a state layer as an alpha channel value.

Parameters
layerThe state layer to look up.
Returns
The opacity scaled and rounded to 0 (transparent) to 255 (opaque); 0.12 gives 31.
Exceptions
std::out_of_rangeWhen layer is StateLayer::Count.

Definition at line 111 of file tokens.cpp.

Here is the call graph for this function:

◆ getOpacity()

float guillaume::theme::StateLayerScale::getOpacity ( StateLayer layer) const

Get the opacity of a state layer.

Parameters
layerThe state layer to look up.
Returns
The opacity, 0 (invisible) to 1 (opaque).
Exceptions
std::out_of_rangeWhen layer is StateLayer::Count.

Definition at line 106 of file tokens.cpp.

Here is the caller graph for this function:

◆ setOpacity()

void guillaume::theme::StateLayerScale::setOpacity ( StateLayer layer,
float opacity )

Replace the opacity of a state layer.

Parameters
layerThe state layer to change.
opacityThe new opacity, 0 to 1.
Exceptions
std::out_of_rangeWhen layer is StateLayer::Count.
std::invalid_argumentWhen opacity is outside 0 to 1.

Definition at line 117 of file tokens.cpp.


The documentation for this class was generated from the following files: