5#ifndef INCLUDE_FIFECHAN_COLOR_HPP_
6#define INCLUDE_FIFECHAN_COLOR_HPP_
20#include "fifechan/platform.hpp"
95 explicit Color(
int hexColor);
108 explicit Color(std::string
const & colorString);
136 Color(uint8_t
r, uint8_t
g, uint8_t
b, uint8_t
a = 255);
338 friend FIFEGUI_API std::ostream&
operator<<(std::ostream& out,
Color const & color);
363 void parseHex(std::string
const & hex);
374 void parseRGB(std::string
const & rgbString);
384 void parseRGBA(std::string
const & rgbaString);
397 static std::vector<int> parseColorComponents(std::string
const & colors,
bool withAlpha =
false);
uint8_t a
Alpha color component (0-255).
Color & operator+=(Color const &color)
Adds the RGB values of another color to this color.
Color toGrayScale() const
Converts the color to grayscale.
Color & operator=(Color &&)=default
Move assignment operator.
std::string toRGBString() const
Returns the color in the form "rgb(r,g,b)".
std::string toHexString() const
Returns the color as a hexadecimal string in the form "#RRGGBB".
std::string toRGBAString() const
Returns the color in the form "rgba(r,g,b,a)".
Color(Color &&)=default
Move constructor.
Color(Color const &)=default
Copy constructor.
Color operator+(Color const &color) const
Adds the RGB values of two colors together.
Color lighten(float percentage) const
Lightens the color by a percentage.
Color & operator*=(float value)
Multiplies the RGB values of this color with a float value.
Color operator*(float value) const
Multiplies the RGB values of a color with a float value.
uint8_t b
Blue color component (0-255).
Color darken(float percentage) const
Darkens the color by a percentage.
bool operator==(Color const &color) const
Compares two colors.
uint8_t g
Green color component (0-255).
bool operator!=(Color const &color) const
Compares two colors.
friend FIFEGUI_API std::ostream & operator<<(std::ostream &out, Color const &color)
Output operator for output.
Color operator-(Color const &color) const
Subtracts the RGB values of one color from another.
Color & operator=(Color const &)=default
Copy assignment operator.
Color()=default
Default constructor.
Color blendWith(Color const &other) const
Blends the color with another color using alpha blending.
uint8_t r
Red color component (0-255).
Color & operator-=(Color const &color)
Subtracts the RGB values of another color from this color.
~Color()=default
Destructor.
Used replacement tokens by configure_file():