Current Version: 1.0.33
Project Name: csspp
Public Member Functions | Private Attributes | List of all members
csspp::color Class Reference

#include <color.h>

Public Member Functions

void adjust_hue (float hue)
 
void adjust_lightness (float change)
 
void adjust_saturation (float change)
 
rgba_color_t get_color () const
 
void get_color (color_component_t &red, color_component_t &green, color_component_t &blue, color_component_t &alpha) const
 
void get_hsl (color_component_t &hue, color_component_t &saturation, color_component_t &lightness, color_component_t &alpha) const
 
bool is_solid () const
 
bool is_transparent () const
 
void set_color (byte_component_t red, byte_component_t green, byte_component_t blue, byte_component_t alpha)
 
void set_color (color_component_t red, color_component_t green, color_component_t blue, color_component_t alpha)
 
void set_color (double red, double green, double blue, double alpha)
 
void set_color (int red, int green, int blue, int alpha)
 
void set_color (rgba_color_t const rgba)
 
bool set_color (std::string const &name, bool name_only)
 
void set_color (unsigned int red, unsigned int green, unsigned int blue, unsigned int alpha)
 
void set_hsl (color_component_t h, color_component_t s, color_component_t l, color_component_t alpha)
 
std::string to_string () const
 

Private Attributes

color_component_t f_alpha = 1.0
 
color_component_t f_blue = 0.0
 
color_component_t f_green = 0.0
 
color_component_t f_red = 0.0
 

Detailed Description

Definition at line 40 of file color.h.

Member Function Documentation

◆ adjust_hue()

void csspp::color::adjust_hue ( float  hue)

◆ adjust_lightness()

void csspp::color::adjust_lightness ( float  change)

◆ adjust_saturation()

void csspp::color::adjust_saturation ( float  change)

◆ get_color() [1/2]

rgba_color_t csspp::color::get_color ( ) const

◆ get_color() [2/2]

void csspp::color::get_color ( color_component_t red,
color_component_t green,
color_component_t blue,
color_component_t alpha 
) const

Definition at line 477 of file color.cpp.

References f_alpha, f_blue, f_green, and f_red.

◆ get_hsl()

void csspp::color::get_hsl ( color_component_t hue,
color_component_t saturation,
color_component_t lightness,
color_component_t alpha 
) const

Definition at line 415 of file color.cpp.

References f_alpha, f_blue, f_green, f_red, and M_PI.

◆ is_solid()

bool csspp::color::is_solid ( ) const

Definition at line 485 of file color.cpp.

References f_alpha.

◆ is_transparent()

bool csspp::color::is_transparent ( ) const

Definition at line 490 of file color.cpp.

References f_alpha.

◆ set_color() [1/7]

void csspp::color::set_color ( byte_component_t  red,
byte_component_t  green,
byte_component_t  blue,
byte_component_t  alpha 
)

Definition at line 236 of file color.cpp.

References f_alpha, f_blue, f_green, and f_red.

◆ set_color() [2/7]

void csspp::color::set_color ( color_component_t  red,
color_component_t  green,
color_component_t  blue,
color_component_t  alpha 
)

Definition at line 260 of file color.cpp.

References f_alpha, f_blue, f_green, and f_red.

◆ set_color() [3/7]

void csspp::color::set_color ( double  red,
double  green,
double  blue,
double  alpha 
)

Definition at line 268 of file color.cpp.

References f_alpha, f_blue, f_green, and f_red.

◆ set_color() [4/7]

void csspp::color::set_color ( int  red,
int  green,
int  blue,
int  alpha 
)

Definition at line 244 of file color.cpp.

References f_alpha, f_blue, f_green, and f_red.

◆ set_color() [5/7]

void csspp::color::set_color ( rgba_color_t const  rgba)

◆ set_color() [6/7]

bool csspp::color::set_color ( std::string const &  name,
bool  name_only 
)

◆ set_color() [7/7]

void csspp::color::set_color ( unsigned int  red,
unsigned int  green,
unsigned int  blue,
unsigned int  alpha 
)

Definition at line 252 of file color.cpp.

References f_alpha, f_blue, f_green, and f_red.

◆ set_hsl()

void csspp::color::set_hsl ( color_component_t  h,
color_component_t  s,
color_component_t  l,
color_component_t  alpha 
)

◆ to_string()

std::string csspp::color::to_string ( ) const

Member Data Documentation

◆ f_alpha

color_component_t csspp::color::f_alpha = 1.0
private

◆ f_blue

color_component_t csspp::color::f_blue = 0.0
private

◆ f_green

color_component_t csspp::color::f_green = 0.0
private

◆ f_red

color_component_t csspp::color::f_red = 0.0
private

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

Documentation of CSS Preprocessor.

This document is part of the Snap! Websites Project.

Copyright by Made to Order Software Corp.