MapLibre Native Core
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
mbgl::Color Class Reference

#include <color.hpp>

Public Member Functions

 Color ()=default
 
 Color (float r_, float g_, float b_, float a_)
 
std::string stringify () const
 
std::array< double, 4 > toArray () const
 
mbgl::Value toObject () const
 
mbgl::Value serialize () const
 

Static Public Member Functions

static Color black ()
 
static Color white ()
 
static Color red ()
 
static Color green ()
 
static Color blue ()
 
static std::optional< Colorparse (const std::string &)
 

Public Attributes

float r = 0.0f
 
float g = 0.0f
 
float b = 0.0f
 
float a = 0.0f
 

Detailed Description

Definition at line 13 of file color.hpp.

Constructor & Destructor Documentation

◆ Color() [1/2]

mbgl::Color::Color ( )
default

◆ Color() [2/2]

mbgl::Color::Color ( float  r_,
float  g_,
float  b_,
float  a_ 
)
inline

Definition at line 16 of file color.hpp.

Member Function Documentation

◆ black()

static Color mbgl::Color::black ( )
inlinestatic

Definition at line 33 of file color.hpp.

◆ blue()

static Color mbgl::Color::blue ( )
inlinestatic

Definition at line 38 of file color.hpp.

◆ green()

static Color mbgl::Color::green ( )
inlinestatic

Definition at line 37 of file color.hpp.

◆ parse()

static std::optional<Color> mbgl::Color::parse ( const std::string &  )
static

◆ red()

static Color mbgl::Color::red ( )
inlinestatic

Definition at line 36 of file color.hpp.

◆ serialize()

mbgl::Value mbgl::Color::serialize ( ) const

◆ stringify()

std::string mbgl::Color::stringify ( ) const

◆ toArray()

std::array<double, 4> mbgl::Color::toArray ( ) const

◆ toObject()

mbgl::Value mbgl::Color::toObject ( ) const

◆ white()

static Color mbgl::Color::white ( )
inlinestatic

Definition at line 34 of file color.hpp.

Member Data Documentation

◆ a

float mbgl::Color::a = 0.0f

Definition at line 31 of file color.hpp.

◆ b

float mbgl::Color::b = 0.0f

Definition at line 30 of file color.hpp.

◆ g

float mbgl::Color::g = 0.0f

Definition at line 29 of file color.hpp.

◆ r

float mbgl::Color::r = 0.0f

Definition at line 28 of file color.hpp.


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