Description

Definition of a visual color.

The red (R), green (G), and blue (B) channels take values between 0 and 1.

#include <ChColor.h>

Public Member Functions

 ChColor (float red, float green, float blue)
 
 ChColor (const ChColor &other)
 
ChColoroperator= (const ChColor &other)
 
void ArchiveOUT (ChArchiveOut &marchive)
 Method to allow serialization of transient data to archives.
 
void ArchiveIN (ChArchiveIn &marchive)
 Method to allow de-serialization of transient data from archives.
 

Static Public Member Functions

static ChVector< float > RGB2HSV (const ChColor &rgb)
 Convert to HSV.
 
static ChColor HSV2RGB (const ChVector< float > &hsv)
 Set from HSV.
 
static ChColor ComputeFalseColor (double v, double vmin, double vmax, bool out_of_range_as_bw=false)
 Compute a false color from a scalar value. More...
 

Public Attributes

float R
 red channel [0,1]
 
float G
 green channel [0,1]
 
float B
 blue channel [0,1]
 

Member Function Documentation

◆ ComputeFalseColor()

ChColor chrono::ChColor::ComputeFalseColor ( double  v,
double  vmin,
double  vmax,
bool  out_of_range_as_bw = false 
)
static

Compute a false color from a scalar value.

Uses a cold-to-hot colormap. The 'v' scalar value is mapped in the vmin-vmax range. If out_of_range_as_bw option is true, then return white for v>vmax and black for v<vmin.


The documentation for this class was generated from the following files:
  • /builds/uwsbel/chrono/src/chrono/assets/ChColor.h
  • /builds/uwsbel/chrono/src/chrono/assets/ChColor.cpp