libpgplotxx.a (C++ interface to PGPLOT)

◆ setrgb()

Tlinestyle & pgplot::Tlinestyle::setrgb ( const Tcol rgb)

set color representation with rgb values

set rgb values

Definition at line 97 of file xpgplotxx.cc.

References pgplot::Tcol::b, Fhls, Frgb, pgplot::Tcol::g, pgplot::helpers::limit(), Mcol, Mflags, and pgplot::Tcol::r.

98  {
99  Mflags &= (~Fhls);
100  Mflags |= Frgb;
101  Mcol.r = helpers::limit(rgb.r, 0., 1.);
102  Mcol.g = helpers::limit(rgb.g, 0., 1.);
103  Mcol.b = helpers::limit(rgb.b, 0., 1.);
104  }
int Mflags
flags
Definition: xpgplotxx.h:129
Tcol Mcol
rgb or hls colour setting
Definition: xpgplotxx.h:131
float r
Definition: structs.h:222
float g
Definition: structs.h:224
float b
Definition: structs.h:226
T limit(const T &v, const T2 &min, const T2 &max)
limit a value to min and max
Definition: xpgplotxx.cc:58
Here is the call graph for this function: