Core::Display::Color
Introduction
The Color
class provides a structured way to manage and manipulate color values, especially when integrating with GLM's vector systems.
Usage
Initialization
The Color
structure comes with four floating-point components for representing RGBA values:
By default, the color is initialized as transparent black.
Working with Vectors
Color
can directly interact with glm::vec3
and glm::vec4
, allowing for streamlined assignments:
For glm::vec3
:
x
corresponds tored
y
corresponds togreen
z
corresponds toblue
For glm::vec4
:
x
corresponds tored
y
corresponds togreen
z
corresponds toblue
w
corresponds toalpha
Operators
Color Operators
Assign color values directly from an initializer list:
Vec3 Operators
Directly assign values from a glm::vec3
:
Vec4 Operators
Similarly, you can assign values from a glm::vec4
:
Last updated