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

A color with a name and a description, as stored in a Scheme or a Palette. More...

#include <headers/guillaume/theme.hpp>

Public Member Functions

 ExtendedColor (void)
 Create a default-constructed color with an empty name and description, not harmonized.
 ExtendedColor (const utility::graphic::Color32Bit &color, const std::string &name, const std::string &description, bool harmonized)
 Create a color with its documentation.
 ~ExtendedColor (void)=default
 Default destructor.
const utility::graphic::Color32Bit & getColor (void) const
 Get the color to draw with.
const std::string & getName (void) const
 Get the name of the color.
const std::string & getDescription (void) const
 Get the text describing what the color is for.
bool isHarmonized (void) const
 Tell whether the color was shifted toward the theme's source color.
void setColor (const utility::graphic::Color32Bit &color)
 Replace the color value; the name and the description are kept.
void setName (const std::string &name)
 Replace the name of the color.
void setDescription (const std::string &description)
 Replace the text describing what the color is for.
void setHarmonized (bool harmonized)
 Mark the color as harmonized or not.

Detailed Description

A color with a name and a description, as stored in a Scheme or a Palette.

Only the color value is used for drawing. The name and the description document the theme (the default theme names each color after its role, "primary", "onPrimary", ...).

Definition at line 157 of file theme.hpp.

Constructor & Destructor Documentation

◆ ExtendedColor()

guillaume::ExtendedColor::ExtendedColor ( const utility::graphic::Color32Bit & color,
const std::string & name,
const std::string & description,
bool harmonized )

Create a color with its documentation.

Parameters
colorThe color, 8 bits per RGBA channel.
nameThe name of the color, such as "primary".
descriptionWhat the color is for; may be empty.
harmonizedTrue when the color was shifted toward the theme's source color, false when it is used as designed.

Member Function Documentation

◆ getColor()

const utility::graphic::Color32Bit & guillaume::ExtendedColor::getColor ( void ) const

Get the color to draw with.

Returns
The color, 8 bits per RGBA channel.

◆ getDescription()

const std::string & guillaume::ExtendedColor::getDescription ( void ) const

Get the text describing what the color is for.

Returns
The description; empty when none was given.

◆ getName()

const std::string & guillaume::ExtendedColor::getName ( void ) const

Get the name of the color.

Returns
The name; empty when none was given.

◆ isHarmonized()

bool guillaume::ExtendedColor::isHarmonized ( void ) const

Tell whether the color was shifted toward the theme's source color.

Returns
True when the color is marked as harmonized. The flag is informative; nothing in the library computes from it.

◆ setColor()

void guillaume::ExtendedColor::setColor ( const utility::graphic::Color32Bit & color)

Replace the color value; the name and the description are kept.

Parameters
colorThe new color, 8 bits per RGBA channel.

◆ setDescription()

void guillaume::ExtendedColor::setDescription ( const std::string & description)

Replace the text describing what the color is for.

Parameters
descriptionThe new description; may be empty.

◆ setHarmonized()

void guillaume::ExtendedColor::setHarmonized ( bool harmonized)

Mark the color as harmonized or not.

Parameters
harmonizedTrue when the color was shifted toward the theme's source color.

◆ setName()

void guillaume::ExtendedColor::setName ( const std::string & name)

Replace the name of the color.

Parameters
nameThe new name.

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