HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
hi::v1::color Class Reference

#include <hikogui/color/color_intf.hpp>

Public Member Functions

constexpr color (color const &) noexcept=default
constexpr color (color &&) noexcept=default
constexpr color & operator= (color const &) noexcept=default
constexpr color & operator= (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
constexpr color (hi::semantic_color semantic_color, float alpha=1.0f) noexcept
constexpr bool is_semantic () const noexcept
constexpr operator semantic_color () const noexcept
size_t hash () const noexcept
constexpr halfr () noexcept
constexpr halfg () noexcept
constexpr halfb () noexcept
constexpr halfa () noexcept
constexpr half r () const noexcept
constexpr half g () const noexcept
constexpr half b () const noexcept
constexpr half a () const noexcept
constexpr bool holds_invariant () const noexcept

Static Public Member Functions

static constexpr color blue () noexcept
static constexpr color green () noexcept
static constexpr color indigo () noexcept
static constexpr color orange () noexcept
static constexpr color pink () noexcept
static constexpr color purple () noexcept
static constexpr color red () noexcept
static constexpr color teal () noexcept
static constexpr color yellow () noexcept
static constexpr color gray () noexcept
static constexpr color gray2 () noexcept
static constexpr color gray3 () noexcept
static constexpr color gray4 () noexcept
static constexpr color gray5 () noexcept
static constexpr color gray6 () noexcept
static constexpr color foreground () noexcept
static constexpr color border () noexcept
static constexpr color fill () noexcept
static constexpr color accent () noexcept
static constexpr color text_select () noexcept
static constexpr color primary_cursor () noexcept
static constexpr color secondary_cursor () noexcept
static constexpr color transparent () noexcept
static constexpr color white () noexcept
static constexpr color black () 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 operator* (matrix3 const &lhs, color const &rhs) noexcept
 Transform a color by a color matrix.

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:

  • the ITU-R BT.709 color primaries.
  • A linear transfer function (unlike sRGB).
  • R=0.0, G=0.0, B=0.0: Black
  • R=1.0, G=1.0, B=1.0: White D65 at 80 nits (80 cd/m^2).
  • RGB values above 1.0 are allowed for HDR (high dynamic range)
  • RGB values below 0.0 are allowed for WCG (wide color gamut)

scRGBA details:

  • Includes an alpha value
  • Alpha values are linear and must be between 0.0 and 1.0.
  • A=0.0 fully transparent
  • A=1.0 fully opaque
  • RGB values are NOT pre-multiplied with the alpha.

◆ operator*

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: