SVG for C++
Loading...
Searching...
No Matches
SVG::Color Class Reference

#include <svg.hpp>

Public Member Functions

Color mix (const Color &other, double amount) const
Color tint (double amount) const
Color shade (double amount) const
 operator std::string () const

Static Public Member Functions

static Color rgb (int red, int green, int blue)
static Color hex (std::string value)
static Color hsl (double hue, double saturation, double lightness)
static Color white ()
static Color black ()

Detailed Description

CSS color value stored as concrete sRGB channels for palette math.

Member Function Documentation

◆ black()

Color SVG::Color::black ( )
inlinestatic

Common palette anchor for shading and mixing.

◆ hex()

Color SVG::Color::hex ( std::string value)
inlinestatic

Build a normalized hex color from 3 or 6 hexadecimal digits.

◆ hsl()

Color SVG::Color::hsl ( double hue,
double saturation,
double lightness )
inlinestatic

Build an sRGB color from hue degrees and saturation/lightness percentages.

◆ mix()

Color SVG::Color::mix ( const Color & other,
double amount ) const
inline

Mix this color toward another color by a 0.0-1.0 amount.

◆ operator std::string()

SVG::Color::operator std::string ( ) const
inline

Allow Color to be used anywhere an attribute accepts std::string.

◆ rgb()

Color SVG::Color::rgb ( int red,
int green,
int blue )
inlinestatic

Build an rgb() color from 8-bit channel values.

◆ shade()

Color SVG::Color::shade ( double amount) const
inline

Mix this color toward black.

◆ tint()

Color SVG::Color::tint ( double amount) const
inline

Mix this color toward white.

◆ white()

Color SVG::Color::white ( )
inlinestatic

Common palette anchor for tinting and mixing.


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