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

The six elevation levels of a theme: one ElevationToken per ElevationLevel. More...

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

Public Member Functions

 ElevationScale (void)
 Create the scale with the Material 3 baseline values.
const ElevationToken & get (ElevationLevel level) const
 Get the shadow and tint of a level.
void set (ElevationLevel level, const ElevationToken &token)
 Replace the shadow and tint of a level.
utility::graphic::Color32Bit tint (const utility::graphic::Color32Bit &surface, const utility::graphic::Color32Bit &tint, ElevationLevel level) const
 Compute the color of a surface raised to a level: the tint color blended over the surface color at the level's tint opacity.

Detailed Description

The six elevation levels of a theme: one ElevationToken per ElevationLevel.

The default values grow with the level, from no shadow and no tint at Level0 to a 12 dp shadow and a 14 % tint at Level5. The tint opacities are those of react-native-paper's Material 3 themes.

Read it through guillaume::getElevationToken and guillaume::getElevatedSurfaceColor.

See also
guillaume::Theme::getElevations

Definition at line 169 of file tokens.hpp.

Constructor & Destructor Documentation

◆ ElevationScale()

guillaume::theme::ElevationScale::ElevationScale ( void )

Create the scale with the Material 3 baseline values.

Definition at line 68 of file tokens.cpp.

Member Function Documentation

◆ get()

const ElevationToken & guillaume::theme::ElevationScale::get ( ElevationLevel level) const

Get the shadow and tint of a level.

Parameters
levelThe elevation level to look up.
Returns
The token of that level, read-only.
Exceptions
std::out_of_rangeWhen level is ElevationLevel::Count.

Definition at line 80 of file tokens.cpp.

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

◆ set()

void guillaume::theme::ElevationScale::set ( ElevationLevel level,
const ElevationToken & token )

Replace the shadow and tint of a level.

Parameters
levelThe elevation level to change.
tokenThe new values. They are stored as given, without range check.
Exceptions
std::out_of_rangeWhen level is ElevationLevel::Count.

Definition at line 85 of file tokens.cpp.

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

◆ tint()

utility::graphic::Color32Bit guillaume::theme::ElevationScale::tint ( const utility::graphic::Color32Bit & surface,
const utility::graphic::Color32Bit & tint,
ElevationLevel level ) const

Compute the color of a surface raised to a level: the tint color blended over the surface color at the level's tint opacity.

Parameters
surfaceThe color of the surface when it is flat.
tintThe color to blend over it (the scheme's SurfaceTint). Its own alpha is ignored.
levelThe elevation level of the surface.
Returns
The tinted surface color.
Exceptions
std::out_of_rangeWhen level is ElevationLevel::Count.

Definition at line 91 of file tokens.cpp.

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

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