mousetrap v0.2.0
Loading...
Searching...
No Matches
mousetrap::HSVA Struct Reference

color representation in HSVA More...

#include <color.hpp>

Public Member Functions

 HSVA ()=default
 default ctor
 
 HSVA (float h, float s, float v, float a)
 construct
 
 HSVA (glm::vec4)
 
 operator glm::vec4 () const
 
 HSVA (RGBA)
 convert rgba to hsva
 
 operator RGBA () const
 convert hsva to rgba
 
 operator std::string () const
 serialize
 
bool operator== (const HSVA &other)
 comparison operator
 
bool operator!= (const HSVA &other)
 comparison operator
 

Public Attributes

float h = 0
 hue component
 
float s = 0
 saturation component
 
float v = 0
 value component
 
float a = 1
 transparency component
 

Detailed Description

color representation in HSVA

Constructor & Destructor Documentation

◆ HSVA() [1/2]

mousetrap::HSVA::HSVA ( float  h,
float  s,
float  v,
float  a 
)

construct

Parameters
hhue, in [0, 1]
ssaturation, in [0, 1]
vvalue, in [0, 1]
aalpha, in [0, 1]

◆ HSVA() [2/2]

mousetrap::HSVA::HSVA ( RGBA  rgba)
explicit

convert rgba to hsva

Parameters
rgba

References a, h, s, and v.

Member Function Documentation

◆ operator!=()

bool mousetrap::HSVA::operator!= ( const HSVA other)

comparison operator

Parameters
other
Returns
true if all components do not exaclty equal eachother, false otherwise. This is subject to issues stemming from float precision, consider quantizing the colors before comparison

◆ operator==()

bool mousetrap::HSVA::operator== ( const HSVA other)

comparison operator

Parameters
other
Returns
true if all components exactly equal eachother, false otherwise. This is subject to issues stemming from float precision, consider quantizing the colors before comparison

References a, h, s, and v.


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