cat3d
A tiny OpenGL 3D engine library written in and for C++.
Static Public Member Functions | Public Attributes | List of all members
cat3d::color Class Reference

Base color class. More...

#include <color.hpp>

Static Public Member Functions

static color from_rgb (float r=0, float g=0, float b=0, float a=255)
 Generate a color from standard 0-255 RGBA values. More...
 
static color from_rgb_clamped (float r=0, float g=0, float b=0, float a=1)
 Generate a color from clamped OpenGL 0-1 RGBA values. More...
 

Public Attributes

float r = 0
 
float g = 0
 
float b = 0
 
float a = 1
 

Detailed Description

Base color class.

Remarks
Stored internally as an OpenGL color, from 0-1.

Member Function Documentation

◆ from_rgb()

static color cat3d::color::from_rgb ( float  r = 0,
float  g = 0,
float  b = 0,
float  a = 255 
)
static

Generate a color from standard 0-255 RGBA values.

Parameters
r
g
b
a

◆ from_rgb_clamped()

static color cat3d::color::from_rgb_clamped ( float  r = 0,
float  g = 0,
float  b = 0,
float  a = 1 
)
static

Generate a color from clamped OpenGL 0-1 RGBA values.

Parameters
r
g
b
a
Returns
color

The documentation for this class was generated from the following file: