libdcp
Public Member Functions | Public Attributes | List of all members
dcp::Colour Class Reference

An RGB colour. More...

#include <types.h>

Public Member Functions

 Colour ()
 
 Colour (int r_, int g_, int b_)
 
 Colour (std::string argb_hex)
 
std::string to_rgb_string () const
 
std::string to_argb_string () const
 

Public Attributes

int r = 0
 red component, from 0 to 255
 
int g = 0
 green component, from 0 to 255
 
int b = 0
 blue component, from 0 to 255
 

Detailed Description

An RGB colour.

Definition at line 300 of file types.h.

Constructor & Destructor Documentation

◆ Colour() [1/3]

Colour::Colour ( )

Construct a Colour, initialising it to black

Definition at line 112 of file types.cc.

◆ Colour() [2/3]

Colour::Colour ( int  r_,
int  g_,
int  b_ 
)

Construct a Colour from R, G and B. The values run between 0 and 255.

Definition at line 118 of file types.cc.

◆ Colour() [3/3]

Colour::Colour ( std::string  argb_hex)
explicit

Construct a Colour from an ARGB hex string; the alpha value is ignored.

Parameters
argb_hexA string of the form AARRGGBB, where e.g. RR is a two-character hex value.

Definition at line 127 of file types.cc.

Member Function Documentation

◆ to_argb_string()

string Colour::to_argb_string ( ) const
Returns
An ARGB string of the form AARRGGBB, where e.g. RR is a two-character hex value. The alpha value will always be FF (ie 255; maximum alpha).

Definition at line 137 of file types.cc.

◆ to_rgb_string()

string Colour::to_rgb_string ( ) const
Returns
An RGB string of the form RRGGBB, where e.g. RR is a two-character hex value.

Definition at line 146 of file types.cc.


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