utility 2026.1.9
A comprehensive C++ utilities library tailored for the development of modern desktop and extended reality (XR) applications.
Loading...
Searching...
No Matches
color.hpp File Reference

RGBA color representation with blending and manipulation operations. More...

#include <algorithm>
#include <cstdint>
#include <ostream>
#include <stdexcept>
#include <type_traits>
#include <utility>
Include dependency graph for color.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  utility::graphic::Color< Type >
 RGBA color with arithmetic type components. More...
 

Namespaces

namespace  utility
 The utility namespace contains classes and functions for the utility project.
 

Concepts

concept  utility::graphic::CanBeColorComponent
 Concept to ensure the type can be used as a color component.
 

Typedefs

using utility::graphic::Color32Bit = Color< std::uint8_t >
 Common 32-bit RGBA color type with uint8_t components.
 
using utility::graphic::ColorFloat = Color< float >
 Common floating-point RGBA color type with float components.
 
using utility::graphic::ColorDouble = Color< double >
 Common double-precision RGBA color type with double components.
 

Functions

std::ostream & utility::graphic::operator<< (std::ostream &stream, const Color32Bit &color)
 Stream insertion operator for Color.
 
std::ostream & utility::graphic::operator<< (std::ostream &stream, const ColorFloat &color)
 Stream insertion operator for Color.
 
std::ostream & utility::graphic::operator<< (std::ostream &stream, const ColorDouble &color)
 Stream insertion operator for Color.
 

Detailed Description

RGBA color representation with blending and manipulation operations.

Declares graphic::Color<Type>, supporting RGBA color components with operations for blending, grayscale conversion, and color manipulation.

Definition in file color.hpp.

Typedef Documentation

◆ Color32Bit

using utility::graphic::Color32Bit = typedef Color<std::uint8_t>

Common 32-bit RGBA color type with uint8_t components.

Definition at line 546 of file color.hpp.

◆ ColorDouble

using utility::graphic::ColorDouble = typedef Color<double>

Common double-precision RGBA color type with double components.

Definition at line 556 of file color.hpp.

◆ ColorFloat

using utility::graphic::ColorFloat = typedef Color<float>

Common floating-point RGBA color type with float components.

Definition at line 551 of file color.hpp.

Function Documentation

◆ operator<<() [1/3]

std::ostream & utility::graphic::operator<< ( std::ostream &  stream,
const Color32Bit color 
)

Stream insertion operator for Color.

Parameters
streamOutput stream.
colorColor to output.
Returns
Reference to the output stream.

Definition at line 27 of file color.cpp.

Here is the call graph for this function:

◆ operator<<() [2/3]

std::ostream & utility::graphic::operator<< ( std::ostream &  stream,
const ColorDouble color 
)

Stream insertion operator for Color.

Parameters
streamOutput stream.
colorColor to output.
Returns
Reference to the output stream.

Definition at line 43 of file color.cpp.

Here is the call graph for this function:

◆ operator<<() [3/3]

std::ostream & utility::graphic::operator<< ( std::ostream &  stream,
const ColorFloat color 
)

Stream insertion operator for Color.

Parameters
streamOutput stream.
colorColor to output.
Returns
Reference to the output stream.

Definition at line 36 of file color.cpp.

Here is the call graph for this function: