AUI Framework  master
Cross-platform module-based framework for developing C++20 desktop applications
AColor Class Reference

Represents a 4-component floating point color. More...

Detailed Description

Represents a 4-component floating point color.

Public Member Functions

constexpr AColor (const glm::vec4 &v)
 
API_AUI_CORE AColor (const AString &s)
 
constexpr AColor (float scalar)
 
constexpr AColor (float r, float g, float b)
 
constexpr AColor (float r, float g, float b, float a)
 
constexpr AColor (unsigned int color)
 
constexpr AColor operator* (float other) const
 
API_AUI_CORE AString toString () const
 
API_AUI_CORE float readabilityOfForegroundColor (const AColor &foreground)
 
AColor opacify (float alpha) const noexcept
 Increases the alpha channel by the given value.
 
AColor transparentize (float alpha) const noexcept
 Decreases the alpha channel by the given value.
 
constexpr AColor mul (float d) const
 Multiply all color components except alpha channel (rgb * d, a) More...
 
constexpr AColor darker (float d) const
 
constexpr AColor lighter (float d) const
 
bool isFullyTransparent () const
 
bool isFullyOpaque () const
 
AColor readableBlackOrWhite () const
 
AColor opacify (float d)
 

Static Public Member Functions

static constexpr AColor fromAARRGGBB (unsigned int color)
 
static constexpr AColor fromRRGGBB (unsigned int color)
 

Static Public Attributes

static const AColor BLACK = {0.f, 0.f, 0.f, 1.f}
 
static const AColor WHITE = {1.f, 1.f, 1.f, 1.f}
 
static const AColor RED = {1.f, 0.f, 0.f, 1.f}
 
static const AColor GREEN = {0.f, 1.f, 0.f, 1.f}
 
static const AColor BLUE = {0.f, 0.f, 1.f, 1.f}
 
static const AColor GRAY = {0.5f, 0.5f, 0.5f, 1.f}
 

Member Function Documentation

◆ mul()

constexpr AColor AColor::mul ( float  d) const
inlineconstexpr

Multiply all color components except alpha channel (rgb * d, a)

Parameters
multiplier
Returns
supplyValue color

#include <AUI/Common/AColor.h>


The documentation for this class was generated from the following files:
Inheritance diagram for AColor:
Collaboration diagram for AColor: