SMTK  @SMTK_VERSION@
Simulation Modeling Tool Kit
Static Public Member Functions | List of all members
smtk::common::Color Class Reference

Utilities for dealing with color conversion. More...

#include <Color.h>

Static Public Member Functions

static bool stringToFloatRGBA (double *rgba, const std::string &colorSpec, double defaultAlpha=1.0)
 Convert a string color specifier (colorSpec) into RGBA values in [0,1]^4. More...
 
static bool stringToFloatRGBA (std::vector< double > &rgba, const std::string &colorSpec, double defaultAlpha=1.0)
 Convenience to convert a string color specifier into a vector instead of a pointer.
 
static std::string floatRGBAToString (const double *rgb)
 
static std::string floatRGBAToString (const float *rgb)
 
static std::string floatRGBToString (const double *rgb)
 
static std::string floatRGBToString (const float *rgb)
 
static double floatRGBToLightness (const double *rgb)
 
static float floatRGBToLightness (const float *rgb)
 

Detailed Description

Utilities for dealing with color conversion.

Member Function Documentation

◆ stringToFloatRGBA()

bool smtk::common::Color::stringToFloatRGBA ( double *  rgba,
const std::string &  colorSpec,
double  defaultAlpha = 1.0 
)
static

Convert a string color specifier (colorSpec) into RGBA values in [0,1]^4.

This returns true when colorSpec is a valid color and false otherwise. If false is returned, then rgba is unmodified.


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