54 unsigned char red()
const;
59 unsigned char green()
const;
64 unsigned char blue()
const;
69 unsigned char alpha()
const;
77 void set(
unsigned char r,
unsigned char g,
unsigned char b,
unsigned char a);
141 const char* objectid,
bool report,
bool& ok);
bool myValid
flag to check if color is valid
static RGBColor interpolate(const RGBColor &minColor, const RGBColor &maxColor, double weight)
Interpolates between two colors.
unsigned char myRed
The color amounts.
void setValid(const bool value)
set valid
void setAlpha(unsigned char alpha)
Sets a new alpha value.
static const RGBColor WHITE
unsigned char red() const
Returns the red-amount of the color.
static const std::string DEFAULT_COLOR_STRING
The string description of the default color.
static const RGBColor BLUE
unsigned char alpha() const
Returns the alpha-amount of the color.
static const RGBColor GREY
static const RGBColor YELLOW
static SumoRNG myRNG
A random number generator to generate random colors independent of other randomness.
static const RGBColor INVISIBLE
RGBColor(bool valid=true)
Constructor.
static SumoRNG * getColorRNG()
get color RNG
RGBColor multiply(double factor) const
Returns a new color with altered brightness.
static RGBColor parseColor(std::string coldef)
Parses a color information.
static RGBColor parseColorReporting(const std::string &coldef, const std::string &objecttype, const char *objectid, bool report, bool &ok)
Parses a color information.
unsigned char green() const
Returns the green-amount of the color.
static const RGBColor ORANGE
static const RGBColor CYAN
RGBColor invertedColor() const
obtain inverted of current RGBColor
bool isValid() const
check if RGBColor is valid
static const RGBColor GREEN
static RGBColor fromHSV(double h, double s, double v)
Converts the given hsv-triplet to rgb, inspired by http://alvyray.com/Papers/CG/hsv2rgb....
unsigned char blue() const
Returns the blue-amount of the color.
friend std::ostream & operator<<(std::ostream &os, const RGBColor &col)
Writes the color to the given stream.
static const RGBColor BLACK
RGBColor changedBrightness(int change, int toChange=3) const
Returns a new color with altered brightness.
bool operator!=(const RGBColor &c) const
void set(unsigned char r, unsigned char g, unsigned char b, unsigned char a)
assigns new values
RGBColor changedAlpha(int change) const
Returns a new color with altered opacity.
static const RGBColor MAGENTA
bool operator==(const RGBColor &c) const
static const RGBColor DEFAULT_COLOR
The default color (for vehicle types and vehicles)
static const RGBColor RED
named colors
static RGBColor randomHue(double s=1, double v=1)
Return color with random hue.