16 Color(
float r_,
float g_,
float b_,
float a_)
17 :
r(r_),
g(g_),
b(b_),
a(a_) {
33 static Color black() {
return { 0.0f, 0.0f, 0.0f, 1.0f }; };
34 static Color white() {
return { 1.0f, 1.0f, 1.0f, 1.0f }; };
36 static Color red() {
return { 1.0f, 0.0f, 0.0f, 1.0f }; };
37 static Color green() {
return { 0.0f, 1.0f, 0.0f, 1.0f }; };
38 static Color blue() {
return { 0.0f, 0.0f, 1.0f, 1.0f }; };
48 return colorA.
r == colorB.
r && colorA.
g == colorB.
g && colorA.
b == colorB.
b && colorA.
a == colorB.
a;
52 return !(colorA == colorB);
56 assert(alpha >= 0.0f);
57 assert(alpha <= 1.0f);
static std::optional< Color > parse(const std::string &)
mbgl::Value serialize() const
Color(float r_, float g_, float b_, float a_)
std::string stringify() const
mbgl::Value toObject() const
std::array< double, 4 > toArray() const
std::unique_ptr< Expression > string(std::unique_ptr< Expression >, std::unique_ptr< Expression > def=nullptr)
constexpr bool operator==(const CameraOptions &a, const CameraOptions &b)
mapbox::base::Value Value
constexpr bool operator!=(const CameraOptions &a, const CameraOptions &b)
Color operator*(const Color &color, float alpha)