HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Friends
hi::v1::color Class Reference

#include <hikogui/color/color.hpp>

Public Member Functions

constexpr color (color const &) noexcept=default
 
constexpr color (color &&) noexcept=default
 
constexpr coloroperator= (color const &) noexcept=default
 
constexpr coloroperator= (color &&) noexcept=default
 
constexpr color (f16x4 const &other) noexcept
 
constexpr color (f32x4 const &other) noexcept
 
constexpr operator f16x4 () const noexcept
 
constexpr operator f32x4 () const noexcept
 
constexpr color (float r, float g, float b, float a=1.0f) noexcept
 
size_t hash () const noexcept
 
constexpr float16 & r () noexcept
 
constexpr float16 & g () noexcept
 
constexpr float16 & b () noexcept
 
constexpr float16 & a () noexcept
 
constexpr float16 r () const noexcept
 
constexpr float16 g () const noexcept
 
constexpr float16 b () const noexcept
 
constexpr float16 a () const noexcept
 
constexpr bool holds_invariant () const noexcept
 

Static Public Member Functions

static colorfind (std::string const &name) noexcept
 Find a color by name.
 
static color black () noexcept
 
static color silver () noexcept
 
static color gray () noexcept
 
static color white () noexcept
 
static color maroon () noexcept
 
static color red () noexcept
 
static color purple () noexcept
 
static color fuchsia () noexcept
 
static color green () noexcept
 
static color lime () noexcept
 
static color olive () noexcept
 
static color yellow () noexcept
 
static color navy () noexcept
 
static color blue () noexcept
 
static color teal () noexcept
 
static color aqua () noexcept
 
static color indigo () noexcept
 
static color orange () noexcept
 
static color pink () noexcept
 
static color background () noexcept
 
static color gray1 () noexcept
 
static color gray2 () noexcept
 
static color gray3 () noexcept
 
static color gray4 () noexcept
 
static color gray5 () noexcept
 
static color gray6 () noexcept
 
static color gray7 () noexcept
 
static color gray8 () noexcept
 
static color gray9 () noexcept
 
static color foreground () noexcept
 
static color transparent () noexcept
 

Friends

constexpr friend bool operator== (color const &lhs, color const &rhs) noexcept
 
constexpr friend color operator* (color const &lhs, color const &rhs) noexcept
 
constexpr friend color composit (color const &lhs, color const &rhs) noexcept
 
constexpr friend color desaturate (color const &rhs) noexcept
 
constexpr friend color operator* (matrix3 const &lhs, color const &rhs) noexcept
 Transform a color by a color matrix.
 
constexpr friend color operator* (identity3 const &lhs, color const &rhs) noexcept
 
std::ostreamoperator<< (std::ostream &lhs, color const &rhs)
 

Detailed Description

This is a RGBA floating point color.

The color can be converted between different color spaces using the matrix-class.

But in most cases in the application and hikogui library this color would be in the scRGBA color space. This color space is compatible with the sRGB standard IEC 61966-2-1:1999.

scRGB details:

scRGBA details:

Member Function Documentation

◆ find()

color * hi::v1::color::find ( std::string const & name)
inlinestaticnoexcept

Find a color by name.

Parameters
nameThe name of the color to find.
Returns
A pointer to a writable named-color. Or nullptr when not found.

Friends And Related Symbol Documentation

◆ operator*

constexpr friend color operator* ( matrix3 const & lhs,
color const & rhs )
friend

Transform a color by a color matrix.

The alpha value is not included in the transformation and copied from the input.

Note
It is undefined behavior if the matrix contains a translation.
Parameters
lhsThe 3x3 color transformation matrix to use.
rhsThe color to be transformed.
Returns
The transformed color.

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