|
libosmscout 0.1
|
Representation of a color with red, green and blue value (RGB) and a alpha channel. More...
#include <Color.h>
Public Member Functions | |
| Color | Alpha (double newAlpha) const |
| Color ()=default | |
| Color (double r, double g, double b) noexcept | |
| Color (double r, double g, double b, double a) noexcept | |
| Color | Darken (double factor) const |
| Color | Decolor () const |
| double | GetA () const |
| double | GetB () const |
| double | GetG () const |
| double | GetR () const |
| bool | IsSolid () const |
| bool | IsVisible () const |
| Color | Lighten (double factor) const |
| bool | operator!= (const Color &other) const |
| bool | operator< (const Color &other) const |
| bool | operator== (const Color &other) const |
| std::string | ToHexString () const |
| ~Color ()=default | |
Static Public Member Functions | |
| static Color | FromHexString (const std::string &hexString) |
| Convert the given color string to a color value. | |
| static bool | FromHexString (const std::string &hexString, Color &color) |
| static bool | FromW3CKeywordString (const std::string &colorKeyword, Color &color) |
| Convert the give color keyword to a color value. | |
| static bool | IsHexString (const std::string &hexString) |
Static Public Attributes | |
| static const Color | AQUA |
| static const Color | BLACK |
| static const Color | BLUE |
| static const Color | DARK_AQUA |
| static const Color | DARK_BLUE |
| static const Color | DARK_FUCHSIA |
| static const Color | DARK_GRAY |
| static const Color | DARK_GREEN |
| static const Color | DARK_RED |
| static const Color | DARK_YELLOW |
| static const Color | FUCHSIA |
| static const Color | GRAY |
| static const Color | GREEN |
| static const Color | LIGHT_GRAY |
| static const Color | LIME |
| static const Color | LUCENT_WHITE |
| static const Color | MAROON |
| static const Color | NAVY |
| static const Color | OLIVE |
| static const Color | PURPLE |
| static const Color | RED |
| static const Color | SILVER |
| static const Color | TEAL |
| static const Color | WHITE |
| static const Color | YELLOW |
Representation of a color with red, green and blue value (RGB) and a alpha channel.
This class follow the "rule of zero" (see https://en.cppreference.com/w/cpp/language/rule_of_three)
|
default |
Referenced by FromHexString().
|
default |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
Referenced by osmscout::oss::Parser::ATTRIBUTEVALUE().
|
inline |
Referenced by osmscout::oss::Parser::ATTRIBUTEVALUE(), and osmscout::oss::Parser::COLOR().
|
inline |
|
static |
Convert the given color string to a color value.
The string must either be of the format
where '#' is the symbol itself and 'H' represents a hexadecimal value
| hexString | (lowercase) |
References Color(), and osmscout::GetHexValue().
Referenced by osmscout::oss::Parser::COLOR_VALUE(), FromHexString(), osmscout::ColorFeature::Parse(), and osmscout::OverlayObject::setColor().
|
static |
References FromHexString(), and IsHexString().
|
static |
Convert the give color keyword to a color value.
Just basic color set is supported. See https://www.w3.org/TR/css-color-3/#html4
| colorKeyword | |
| color |
References AQUA, BLACK, BLUE, DARK_AQUA, DARK_BLUE, DARK_FUCHSIA, DARK_GRAY, DARK_GREEN, DARK_RED, DARK_YELLOW, FUCHSIA, GRAY, GREEN, LIGHT_GRAY, LIME, MAROON, NAVY, OLIVE, PURPLE, RED, SILVER, TEAL, WHITE, and YELLOW.
Referenced by osmscout::ColorFeature::Parse(), and osmscout::OverlayObject::setColor().
|
inline |
Referenced by osmscout::MapPainterAgg::DrawPath(), osmscout::MapPainterQt::DrawPath(), osmscout::MapPainterSVG::DrawPath(), osmscout::SymbolRendererCairo::EndPrimitive(), osmscout::TextStyle::GetAlpha(), osmscout::ShieldStyle::GetAlpha(), osmscout::MapPainterQt::HasPattern(), osmscout::TiledMapRenderer::onStylesheetFilenameChanged(), osmscout::PlaneMapRenderer::RenderMap(), and osmscout::FileWriter::Write().
|
inline |
Referenced by osmscout::MapPainterAgg::DrawGround(), osmscout::MapPainterCairo::DrawGround(), osmscout::MapPainterQt::DrawGround(), osmscout::MapPainterAgg::DrawPath(), osmscout::MapPainterQt::DrawPath(), osmscout::SymbolRendererCairo::EndPrimitive(), osmscout::MapPainterQt::HasPattern(), osmscout::TiledMapRenderer::onStylesheetFilenameChanged(), osmscout::PlaneMapRenderer::RenderMap(), osmscout::DBRenderJob::Run(), and osmscout::FileWriter::Write().
|
inline |
Referenced by osmscout::MapPainterAgg::DrawGround(), osmscout::MapPainterCairo::DrawGround(), osmscout::MapPainterQt::DrawGround(), osmscout::MapPainterAgg::DrawPath(), osmscout::MapPainterQt::DrawPath(), osmscout::SymbolRendererCairo::EndPrimitive(), osmscout::MapPainterQt::HasPattern(), osmscout::TiledMapRenderer::onStylesheetFilenameChanged(), osmscout::PlaneMapRenderer::RenderMap(), osmscout::DBRenderJob::Run(), and osmscout::FileWriter::Write().
|
inline |
Referenced by osmscout::MapPainterAgg::DrawGround(), osmscout::MapPainterCairo::DrawGround(), osmscout::MapPainterQt::DrawGround(), osmscout::MapPainterAgg::DrawPath(), osmscout::MapPainterQt::DrawPath(), osmscout::SymbolRendererCairo::EndPrimitive(), osmscout::MapPainterQt::HasPattern(), osmscout::TiledMapRenderer::onStylesheetFilenameChanged(), osmscout::PlaneMapRenderer::RenderMap(), osmscout::DBRenderJob::Run(), and osmscout::FileWriter::Write().
|
static |
Referenced by FromHexString().
|
inline |
Referenced by osmscout::MapPainterSVG::DrawPath().
|
inline |
|
inline |
Referenced by osmscout::oss::Parser::ATTRIBUTEVALUE(), and osmscout::oss::Parser::COLOR().
|
inline |
| bool osmscout::Color::operator< | ( | const Color & | other | ) | const |
|
inline |
| std::string osmscout::Color::ToHexString | ( | ) | const |
References osmscout::GetHexChar().
Referenced by osmscout::ColorFeatureValue::GetLabel(), and osmscout::OverlayObject::setColorValue().
|
static |
Referenced by FromW3CKeywordString().
|
static |
Referenced by osmscout::oss::Parser::COLOR(), and FromW3CKeywordString().
|
static |
Referenced by FromW3CKeywordString().
|
static |
Referenced by FromW3CKeywordString().
|
static |
Referenced by FromW3CKeywordString().
|
static |
Referenced by FromW3CKeywordString().
|
static |
Referenced by FromW3CKeywordString().
|
static |
Referenced by FromW3CKeywordString().
|
static |
Referenced by FromW3CKeywordString().
|
static |
Referenced by FromW3CKeywordString().
|
static |
Referenced by FromW3CKeywordString().
|
static |
Referenced by FromW3CKeywordString().
|
static |
Referenced by FromW3CKeywordString().
|
static |
Referenced by FromW3CKeywordString().
|
static |
Referenced by FromW3CKeywordString().
|
static |
|
static |
Referenced by FromW3CKeywordString().
|
static |
Referenced by FromW3CKeywordString().
|
static |
Referenced by FromW3CKeywordString().
|
static |
Referenced by FromW3CKeywordString().
|
static |
Referenced by FromW3CKeywordString().
|
static |
Referenced by FromW3CKeywordString().
|
static |
Referenced by FromW3CKeywordString().
|
static |
Referenced by FromW3CKeywordString().
|
static |
Referenced by FromW3CKeywordString().