KiCad PCB EDA Suite
KIGFX::COLOR4D Class Reference

Class COLOR4D is the color representation with 4 components: red, green, blue, alpha. More...

#include <color4d.h>

Public Member Functions

 COLOR4D ()
 
 COLOR4D (double aRed, double aGreen, double aBlue, double aAlpha)
 Constructor. More...
 
 COLOR4D (EDA_COLOR_T aColor)
 Constructor. More...
 
void ToHSL (double &aOutHue, double &aOutSaturation, double &aOutValue) const
 Function ToHSL() Converts current color (stored in RGB) to HSL format. More...
 
void FromHSL (double aInHue, double aInSaturation, double aInLightness)
 Function FromHSL() Changes currently used color to the one given by hue, saturation and lightness parameters. More...
 
COLOR4DBrighten (double aFactor)
 Function Brighten Makes the color brighter by a given factor. More...
 
COLOR4DDarken (double aFactor)
 Function Darken Makes the color darker by a given factor. More...
 
COLOR4DInvert ()
 Function Invert Makes the color inverted, alpha remains the same. More...
 
COLOR4DSaturate (double aFactor)
 Saturates the color to a given factor (in HSV model) More...
 
COLOR4D Brightened (double aFactor) const
 Function Brightened Returns a color that is brighter by a given factor, without modifying object. More...
 
COLOR4D Darkened (double aFactor) const
 Function Darkened Returns a color that is darker by a given factor, without modifying object. More...
 
COLOR4D WithAlpha (double aAlpha) const
 Function WithAlpha Returns a colour with the same colour, but the given alpha. More...
 
COLOR4D Inverted () const
 Function Inverted Returns an inverted color, alpha remains the same. More...
 
double GetBrightness () const
 Function GetBrightness Returns the brightness value of the color ranged from 0.0 to 1.0. More...
 
void ToHSV (double &aOutHue, double &aOutSaturation, double &aOutValue, bool aAlwaysDefineHue=false) const
 Function ToHSV() Converts current color (stored in RGB) to HSV format. More...
 
void FromHSV (double aInH, double aInS, double aInV)
 Function FromHSV() Changes currently used color to the one given by hue, saturation and value parameters. More...
 

Public Attributes

double r
 Red component. More...
 
double g
 Green component. More...
 
double b
 Blue component. More...
 
double a
 Alpha component. More...
 

Static Public Attributes

static const COLOR4D UNSPECIFIED
 For legacy support; used as a value to indicate color hasn't been set yet. More...
 
static const COLOR4D WHITE
 
static const COLOR4D BLACK
 

Detailed Description

Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.

Definition at line 39 of file color4d.h.

Constructor & Destructor Documentation

◆ COLOR4D() [1/3]

KIGFX::COLOR4D::COLOR4D ( )
inline

Definition at line 43 of file color4d.h.

43  :
44  r( 0 ), g( 0 ), b( 0 ), a( 1.0 )
45  {
46  }
double g
Green component.
Definition: color4d.h:310
double b
Blue component.
Definition: color4d.h:311
double a
Alpha component.
Definition: color4d.h:312
double r
Red component.
Definition: color4d.h:309

Referenced by Brightened(), Darkened(), Inverted(), and WithAlpha().

◆ COLOR4D() [2/3]

KIGFX::COLOR4D::COLOR4D ( double  aRed,
double  aGreen,
double  aBlue,
double  aAlpha 
)
inline

Constructor.

Parameters
aRedis the red component [0.0 .. 1.0].
aGreenis the green component [0.0 .. 1.0].
aBlueis the blue component [0.0 .. 1.0].
aAlphais the alpha value [0.0 .. 1.0].

Definition at line 56 of file color4d.h.

56  :
57  r( aRed ), g( aGreen ), b( aBlue ), a( aAlpha )
58  {
59  assert( r >= 0.0 && r <= 1.0 );
60  assert( g >= 0.0 && g <= 1.0 );
61  assert( b >= 0.0 && b <= 1.0 );
62  assert( a >= 0.0 && a <= 1.0 );
63  }
double g
Green component.
Definition: color4d.h:310
double b
Blue component.
Definition: color4d.h:311
double a
Alpha component.
Definition: color4d.h:312
double r
Red component.
Definition: color4d.h:309

References a, b, g, and r.

◆ COLOR4D() [3/3]

COLOR4D::COLOR4D ( EDA_COLOR_T  aColor)

Constructor.

Parameters
aColoris one of KiCad's palette colors.
See also
EDA_COLOR_T

Definition at line 32 of file color4d.cpp.

33 {
34  if( aColor <= UNSPECIFIED_COLOR || aColor >= NBCOLORS )
35  {
36  *this = COLOR4D::UNSPECIFIED;
37  return;
38  }
39 
40  r = g_ColorRefs[aColor].m_Red / 255.0;
41  g = g_ColorRefs[aColor].m_Green / 255.0;
42  b = g_ColorRefs[aColor].m_Blue / 255.0;
43  a = 1.0;
44 }
unsigned char m_Red
Definition: colors.h:146
unsigned char m_Green
Definition: colors.h:145
double g
Green component.
Definition: color4d.h:310
static const COLOR4D UNSPECIFIED
For legacy support; used as a value to indicate color hasn't been set yet.
Definition: color4d.h:315
double b
Blue component.
Definition: color4d.h:311
double a
Alpha component.
Definition: color4d.h:312
unsigned char m_Blue
Definition: colors.h:144
const StructColors g_ColorRefs[NBCOLORS]
The predefined colors used in KiCad.
Definition: colors.cpp:37
double r
Red component.
Definition: color4d.h:309
Number of colors.
Definition: colors.h:75

References a, b, g, g_ColorRefs, StructColors::m_Blue, StructColors::m_Green, StructColors::m_Red, NBCOLORS, r, and UNSPECIFIED.

Member Function Documentation

◆ Brighten()

COLOR4D& KIGFX::COLOR4D::Brighten ( double  aFactor)
inline

Function Brighten Makes the color brighter by a given factor.

Parameters
aFactorSpecifies how bright the color should become (valid values: 0.0 .. 1.0).
Returns
COLOR4D& Brightened color.

Definition at line 170 of file color4d.h.

171  {
172  assert( aFactor >= 0.0 && aFactor <= 1.0 );
173 
174  r = r * ( 1.0 - aFactor ) + aFactor;
175  g = g * ( 1.0 - aFactor ) + aFactor;
176  b = b * ( 1.0 - aFactor ) + aFactor;
177 
178  return *this;
179  }
double g
Green component.
Definition: color4d.h:310
double b
Blue component.
Definition: color4d.h:311
double r
Red component.
Definition: color4d.h:309

References b, g, and r.

◆ Brightened()

COLOR4D KIGFX::COLOR4D::Brightened ( double  aFactor) const
inline

Function Brightened Returns a color that is brighter by a given factor, without modifying object.

Parameters
aFactorSpecifies how bright the color should become (valid values: 0.0 .. 1.0).
Returns
COLOR4D Highlighted color.

Definition at line 223 of file color4d.h.

224  {
225  assert( aFactor >= 0.0 && aFactor <= 1.0 );
226 
227  return COLOR4D( r * ( 1.0 - aFactor ) + aFactor,
228  g * ( 1.0 - aFactor ) + aFactor,
229  b * ( 1.0 - aFactor ) + aFactor,
230  a );
231  }
double g
Green component.
Definition: color4d.h:310
double b
Blue component.
Definition: color4d.h:311
double a
Alpha component.
Definition: color4d.h:312
double r
Red component.
Definition: color4d.h:309

References a, b, COLOR4D(), g, and r.

Referenced by KIGFX::GERBVIEW_RENDER_SETTINGS::ImportLegacyColors(), and KIGFX::RENDER_SETTINGS::update().

◆ Darken()

COLOR4D& KIGFX::COLOR4D::Darken ( double  aFactor)
inline

Function Darken Makes the color darker by a given factor.

Parameters
aFactorSpecifies how dark the color should become (valid values: 0.0 .. 1.0).
Returns
COLOR4D& Darkened color.

Definition at line 187 of file color4d.h.

188  {
189  assert( aFactor >= 0.0 && aFactor <= 1.0 );
190 
191  r = r * ( 1.0 - aFactor );
192  g = g * ( 1.0 - aFactor );
193  b = b * ( 1.0 - aFactor );
194 
195  return *this;
196  }
double g
Green component.
Definition: color4d.h:310
double b
Blue component.
Definition: color4d.h:311
double r
Red component.
Definition: color4d.h:309

References b, g, and r.

Referenced by SetLayerColor().

◆ Darkened()

COLOR4D KIGFX::COLOR4D::Darkened ( double  aFactor) const
inline

Function Darkened Returns a color that is darker by a given factor, without modifying object.

Parameters
aFactorSpecifies how dark the color should become (valid values: 0.0 .. 1.0).
Returns
COLOR4D Darkened color.

Definition at line 239 of file color4d.h.

240  {
241  assert( aFactor >= 0.0 && aFactor <= 1.0 );
242 
243  return COLOR4D( r * ( 1.0 - aFactor ),
244  g * ( 1.0 - aFactor ),
245  b * ( 1.0 - aFactor ),
246  a );
247  }
double g
Green component.
Definition: color4d.h:310
double b
Blue component.
Definition: color4d.h:311
double a
Alpha component.
Definition: color4d.h:312
double r
Red component.
Definition: color4d.h:309

References a, b, COLOR4D(), g, and r.

Referenced by KIGFX::GERBVIEW_RENDER_SETTINGS::ImportLegacyColors(), and KIGFX::RENDER_SETTINGS::update().

◆ FromHSL()

void COLOR4D::FromHSL ( double  aInHue,
double  aInSaturation,
double  aInLightness 
)

Function FromHSL() Changes currently used color to the one given by hue, saturation and lightness parameters.

Parameters
aInHueis hue component, in degrees (0.0 - 360.0)
aInSaturationis saturation component (0.0 - 1.0)
aInLightnessis lightness component (0.0 - 1.0)

Definition at line 317 of file color4d.cpp.

318 {
319  const auto P = ( 1.0 - std::abs( 2.0 * aInLightness - 1.0 ) ) * aInSaturation;
320  const auto scaled_hue = aInHue / 60.0;
321  const auto Q = P * ( 1.0 - std::abs( std::fmod( scaled_hue, 2.0 ) - 1.0 ) );
322 
323  r = g = b = aInLightness - P / 2.0;
324 
325  if (scaled_hue < 1.0)
326  {
327  r += P;
328  g += Q;
329  }
330  else if (scaled_hue < 2.0)
331  {
332  r += Q;
333  g += P;
334  }
335  else if (scaled_hue < 3.0)
336  {
337  g += P;
338  b += Q;
339  }
340  else if (scaled_hue < 4.0)
341  {
342  g += Q;
343  b += P;
344  }
345  else if (scaled_hue < 5.0)
346  {
347  r += Q;
348  b += P;
349  }
350  else
351  {
352  r += P;
353  b += Q;
354  }
355 }
double g
Green component.
Definition: color4d.h:310
#define abs(a)
Definition: auxiliary.h:84
double b
Blue component.
Definition: color4d.h:311
double r
Red component.
Definition: color4d.h:309

References abs, b, g, and r.

◆ FromHSV()

void COLOR4D::FromHSV ( double  aInH,
double  aInS,
double  aInV 
)

Function FromHSV() Changes currently used color to the one given by hue, saturation and value parameters.

Parameters
aInHis hue component, in degrees.
aInSis saturation component.
aInVis value component.

Definition at line 411 of file color4d.cpp.

412 {
413  if( aInS <= 0.0 )
414  {
415  r = aInV;
416  g = aInV;
417  b = aInV;
418  return;
419  }
420 
421  double hh = aInH;
422 
423  while( hh >= 360.0 )
424  hh -= 360.0;
425 
426  /* Hue in degrees (0...360) is coded according to this table
427  * 0 or 360 : red
428  * 60 : yellow
429  * 120 : green
430  * 180 : cyan
431  * 240 : blue
432  * 300 : magenta
433  */
434  hh /= 60.0;
435 
436  int i = (int) hh;
437  double ff = hh - i;
438 
439  double p = aInV * ( 1.0 - aInS );
440  double q = aInV * ( 1.0 - ( aInS * ff ) );
441  double t = aInV * ( 1.0 - ( aInS * ( 1.0 - ff ) ) );
442 
443  switch( i )
444  {
445  case 0:
446  r = aInV;
447  g = t;
448  b = p;
449  break;
450 
451  case 1:
452  r = q;
453  g = aInV;
454  b = p;
455  break;
456 
457  case 2:
458  r = p;
459  g = aInV;
460  b = t;
461  break;
462 
463  case 3:
464  r = p;
465  g = q;
466  b = aInV;
467  break;
468 
469  case 4:
470  r = t;
471  g = p;
472  b = aInV;
473  break;
474 
475  case 5:
476  default:
477  r = aInV;
478  g = p;
479  b = q;
480  break;
481  }
482 }
double g
Green component.
Definition: color4d.h:310
double b
Blue component.
Definition: color4d.h:311
size_t i
Definition: json11.cpp:597
double r
Red component.
Definition: color4d.h:309

References b, g, i, and r.

Referenced by DIALOG_COLOR_PICKER::OnChangeBrightness(), DIALOG_COLOR_PICKER::OnChangeEditHue(), DIALOG_COLOR_PICKER::OnChangeEditSat(), Saturate(), and DIALOG_COLOR_PICKER::setHSvaluesFromCursor().

◆ GetBrightness()

double KIGFX::COLOR4D::GetBrightness ( ) const
inline

Function GetBrightness Returns the brightness value of the color ranged from 0.0 to 1.0.

Returns
The brightness value.

Definition at line 277 of file color4d.h.

278  {
279  // Weighted W3C formula
280  return r * 0.299 + g * 0.587 + b * 0.117;
281  }
double g
Green component.
Definition: color4d.h:310
double b
Blue component.
Definition: color4d.h:311
double r
Red component.
Definition: color4d.h:309

References b, g, and r.

Referenced by DrawGraphicHaloText(), KIGFX::SCH_RENDER_SETTINGS::IsBackgroundDark(), KIGFX::PCB_RENDER_SETTINGS::IsBackgroundDark(), and EDIT_POINTS::ViewDraw().

◆ Invert()

COLOR4D& KIGFX::COLOR4D::Invert ( )
inline

Function Invert Makes the color inverted, alpha remains the same.

Returns
COLOR4D& Inverted color.

Definition at line 203 of file color4d.h.

204  {
205  r = ( 1.0 - r );
206  g = ( 1.0 - g );
207  b = ( 1.0 - b );
208 
209  return *this;
210  }
double g
Green component.
Definition: color4d.h:310
double b
Blue component.
Definition: color4d.h:311
double r
Red component.
Definition: color4d.h:309

References b, g, and r.

◆ Inverted()

COLOR4D KIGFX::COLOR4D::Inverted ( ) const
inline

Function Inverted Returns an inverted color, alpha remains the same.

Returns
COLOR4D& Inverted color.

Definition at line 267 of file color4d.h.

268  {
269  return COLOR4D( 1.0 - r, 1.0 - g, 1.0 - b, a );
270  }
double g
Green component.
Definition: color4d.h:310
double b
Blue component.
Definition: color4d.h:311
double a
Alpha component.
Definition: color4d.h:312
double r
Red component.
Definition: color4d.h:309

References a, b, COLOR4D(), g, and r.

Referenced by KIGFX::PCB_RENDER_SETTINGS::ImportLegacyColors().

◆ Saturate()

COLOR4D & COLOR4D::Saturate ( double  aFactor)

Saturates the color to a given factor (in HSV model)

Definition at line 485 of file color4d.cpp.

486 {
487  // One can saturate a color only when r, v, b are not equal
488  if( r == g && r == b )
489  return *this;
490 
491  double h, s, v;
492 
493  ToHSV( h, s, v, true );
494  FromHSV( h, aFactor, 1.0 );
495 
496  return *this;
497 }
void ToHSV(double &aOutHue, double &aOutSaturation, double &aOutValue, bool aAlwaysDefineHue=false) const
Function ToHSV() Converts current color (stored in RGB) to HSV format.
Definition: color4d.cpp:358
double g
Green component.
Definition: color4d.h:310
double b
Blue component.
Definition: color4d.h:311
void FromHSV(double aInH, double aInS, double aInV)
Function FromHSV() Changes currently used color to the one given by hue, saturation and value paramet...
Definition: color4d.cpp:411
double r
Red component.
Definition: color4d.h:309

References b, FromHSV(), g, r, and ToHSV().

◆ ToHSL()

void COLOR4D::ToHSL ( double &  aOutHue,
double &  aOutSaturation,
double &  aOutValue 
) const

Function ToHSL() Converts current color (stored in RGB) to HSL format.

Parameters
aOutHueis the conversion result for hue component, in degrees 0 ... 360.0
aOutSaturationis the conversion result for saturation component (0 ... 1.0).
aOutLightnessis conversion result for value component (0 ... 1.0).
Note
saturation is set to 0.0 for black color if r = g = b,

Definition at line 286 of file color4d.cpp.

287 {
288  auto min = std::min( r, std::min( g, b ) );
289  auto max = std::max( r, std::max( g, b ) );
290  auto diff = max - min;
291 
292  aOutLightness = ( max + min ) / 2.0;
293 
294  if( aOutLightness >= 1.0 )
295  aOutSaturation = 0.0;
296  else
297  aOutSaturation = diff / ( 1.0 - std::abs( 2.0 * aOutLightness - 1.0 ) );
298 
299  double hue;
300 
301  if( diff <= 0.0 )
302  hue = 0.0;
303  else if( max == r )
304  hue = ( g - b ) / diff;
305  else if( max == g )
306  hue = ( b - r ) / diff + 2.0;
307  else
308  hue = ( r - g ) / diff + 4.0;
309 
310  aOutHue = hue > 0.0 ? hue * 60.0 : hue * 60.0 + 360.0;
311 
312  while( aOutHue < 0.0 )
313  aOutHue += 360.0;
314 }
double g
Green component.
Definition: color4d.h:310
#define abs(a)
Definition: auxiliary.h:84
double b
Blue component.
Definition: color4d.h:311
#define max(a, b)
Definition: auxiliary.h:86
double r
Red component.
Definition: color4d.h:309
#define min(a, b)
Definition: auxiliary.h:85

References abs, b, g, max, min, and r.

Referenced by PNS_TUNE_STATUS_POPUP::UpdateStatus().

◆ ToHSV()

void COLOR4D::ToHSV ( double &  aOutHue,
double &  aOutSaturation,
double &  aOutValue,
bool  aAlwaysDefineHue = false 
) const

Function ToHSV() Converts current color (stored in RGB) to HSV format.

Parameters
aOutHueis the conversion result for hue component, in degrees 0 ... 360.0
aOutSaturationis the conversion result for saturation component (0 ... 1.0).
aOutValueis conversion result for value component (0 ... 1.0).
aAlwaysDefineHuecontrols the way hue is defined when r = v = b
Note
saturation is set to 0.0 for black color (r = v = b = 0), and if r = v = b, hue is set to 0.0 if aAlwaysDefineHue = true, and set to NAN if aAlwaysDefineHue = false. this option is usefull to convert a 4D color to a legacy color, because Red has hue = 0, therefore aAlwaysDefineHue = false makes difference between Red and Gray colors.

Definition at line 358 of file color4d.cpp.

359 {
360  double min, max, delta;
361 
362  min = r < g ? r : g;
363  min = min < b ? min : b;
364 
365  max = r > g ? r : g;
366  max = max > b ? max : b;
367 
368  aOutValue = max; // value
369  delta = max - min;
370 
371  if( max > 0.0 )
372  {
373  aOutSaturation = ( delta / max );
374  }
375  else // for black color (r = g = b = 0 ) saturation is set to 0.
376  {
377  aOutSaturation = 0.0;
378  aOutHue = aAlwaysDefineHue ? 0.0 : NAN;
379  return;
380  }
381 
382  /* Hue in degrees (0...360) is coded according to this table
383  * 0 or 360 : red
384  * 60 : yellow
385  * 120 : green
386  * 180 : cyan
387  * 240 : blue
388  * 300 : magenta
389  */
390  if( delta != 0.0 )
391  {
392  if( r >= max )
393  aOutHue = ( g - b ) / delta; // between yellow & magenta
394  else if( g >= max )
395  aOutHue = 2.0 + ( b - r ) / delta; // between cyan & yellow
396  else
397  aOutHue = 4.0 + ( r - g ) / delta; // between magenta & cyan
398 
399  aOutHue *= 60.0; // degrees
400 
401  if( aOutHue < 0.0 )
402  aOutHue += 360.0;
403  }
404  else // delta = 0 means r = g = b. hue is set to 0.0
405  {
406  aOutHue = aAlwaysDefineHue ? 0.0 : NAN;
407  }
408 }
double g
Green component.
Definition: color4d.h:310
static const int delta[8][2]
Definition: solve.cpp:112
double b
Blue component.
Definition: color4d.h:311
#define max(a, b)
Definition: auxiliary.h:86
double r
Red component.
Definition: color4d.h:309
#define min(a, b)
Definition: auxiliary.h:85

References b, delta, g, max, min, and r.

Referenced by DIALOG_COLOR_PICKER::buttColorClick(), DIALOG_COLOR_PICKER::DIALOG_COLOR_PICKER(), DIALOG_COLOR_PICKER::onRGBMouseDrag(), Saturate(), and DIALOG_COLOR_PICKER::SetEditVals().

◆ WithAlpha()

COLOR4D KIGFX::COLOR4D::WithAlpha ( double  aAlpha) const
inline

Function WithAlpha Returns a colour with the same colour, but the given alpha.

Parameters
aAlphaspecifies the alpha of the new color
Returns
COLOR4D color with that alpha

Definition at line 255 of file color4d.h.

256  {
257  assert( aAlpha >= 0.0 && aAlpha <= 1.0 );
258 
259  return COLOR4D( r, g, b, aAlpha );
260  }
double g
Green component.
Definition: color4d.h:310
double b
Blue component.
Definition: color4d.h:311
double r
Red component.
Definition: color4d.h:309

References b, COLOR4D(), g, and r.

Referenced by deemphasise(), LAYER_SELECTOR::DrawColorSwatch(), COLOR_SWATCH::MakeBitmap(), PCB_EDIT_FRAME::PrepareLayerIndicator(), and PARAM_CFG_SETCOLOR::ReadParam().

Member Data Documentation

◆ a

double KIGFX::COLOR4D::a

Alpha component.

Definition at line 312 of file color4d.h.

Referenced by KIGFX::OPENGL_GAL::BitmapText(), KIGFX::OPENGL_GAL::blitCursor(), Brightened(), KIGFX::CAIRO_GAL_BASE::ChangeGroupColor(), KIGFX::VERTEX_MANAGER::ChangeItemColor(), KIGFX::VERTEX_MANAGER::Color(), COLOR4D(), Darkened(), DIALOG_COLOR_PICKER::DIALOG_COLOR_PICKER(), KIGFX::OPENGL_GAL::DrawArc(), KIGFX::CAIRO_GAL_BASE::DrawArcSegment(), KIGFX::OPENGL_GAL::DrawArcSegment(), KIGFX::CAIRO_GAL_BASE::drawAxes(), KIGFX::OPENGL_GAL::DrawCircle(), KIGFX::OPENGL_GAL::DrawGrid(), KIGFX::CAIRO_GAL_BASE::drawGridCross(), KIGFX::CAIRO_GAL_BASE::drawGridLine(), KIGFX::CAIRO_GAL_BASE::drawGridPoint(), KIGFX::CAIRO_GAL_BASE::DrawGroup(), KIGFX::OPENGL_GAL::DrawLine(), KIGFX::OPENGL_GAL::drawPolygon(), KIGFX::OPENGL_GAL::drawPolyline(), KIGFX::OPENGL_GAL::DrawRectangle(), KIGFX::CAIRO_GAL_BASE::DrawSegment(), KIGFX::OPENGL_GAL::DrawSegment(), KIGFX::OPENGL_GAL::drawSemiCircle(), KIGFX::OPENGL_GAL::drawTriangulatedPolyset(), KIGFX::CAIRO_GAL_BASE::flushPath(), KIGFX::GERBVIEW_RENDER_SETTINGS::ImportLegacyColors(), KIGFX::PCB_RENDER_SETTINGS::ImportLegacyColors(), Inverted(), PCBNEW_CONTROL::LayerAlphaDec(), PCBNEW_CONTROL::LayerAlphaInc(), DIALOG_COLOR_PICKER::OnChangeAlpha(), PCB_LAYER_WIDGET::OnLayerColorChange(), KIGFX::operator==(), DIALOG_COLOR_PICKER::SetEditVals(), KIGFX::CAIRO_GAL_BASE::SetFillColor(), DIALOG_COLOR_PICKER::setIconColor(), SCH_LINE::SetLineColor(), KIGFX::CAIRO_GAL_BASE::SetStrokeColor(), KIGFX::CAIRO_GAL_BASE::storePath(), PCB_LAYER_WIDGET::SyncLayerAlphaIndicators(), and ROUTER_PREVIEW_ITEM::Update().

◆ b

double KIGFX::COLOR4D::b

Blue component.

Definition at line 311 of file color4d.h.

Referenced by KIGFX::OPENGL_GAL::BitmapText(), KIGFX::OPENGL_GAL::blitCursor(), Brighten(), Brightened(), DIALOG_COLOR_PICKER::buttColorClick(), KIGFX::CAIRO_GAL_BASE::ChangeGroupColor(), KIGFX::VERTEX_MANAGER::ChangeItemColor(), KIGFX::OPENGL_COMPOSITOR::ClearBuffer(), KIGFX::CAIRO_GAL_BASE::ClearScreen(), KIGFX::VERTEX_MANAGER::Color(), COLOR4D(), CUSTOM_COLOR_ITEM::CUSTOM_COLOR_ITEM(), Darken(), Darkened(), KIGFX::OPENGL_GAL::DrawArc(), KIGFX::CAIRO_GAL_BASE::DrawArcSegment(), KIGFX::OPENGL_GAL::DrawArcSegment(), KIGFX::CAIRO_GAL_BASE::drawAxes(), KIGFX::OPENGL_GAL::drawBitmapOverbar(), KIGFX::OPENGL_GAL::DrawCircle(), KIGFX::OPENGL_GAL::DrawGrid(), KIGFX::CAIRO_GAL_BASE::drawGridCross(), KIGFX::CAIRO_GAL_BASE::drawGridLine(), KIGFX::CAIRO_GAL_BASE::drawGridPoint(), KIGFX::CAIRO_GAL_BASE::DrawGroup(), KIGFX::OPENGL_GAL::DrawLine(), KIGFX::OPENGL_GAL::drawPolygon(), KIGFX::OPENGL_GAL::drawPolyline(), KIGFX::OPENGL_GAL::DrawRectangle(), DIALOG_COLOR_PICKER::drawRGBPalette(), KIGFX::CAIRO_GAL_BASE::DrawSegment(), KIGFX::OPENGL_GAL::DrawSegment(), KIGFX::OPENGL_GAL::drawSemiCircle(), KIGFX::OPENGL_GAL::drawTriangulatedPolyset(), KIGFX::CAIRO_GAL_BASE::flushPath(), FromHSL(), FromHSV(), GetBrightness(), CINFO3D_VISU::GetColor(), getDXFColorName(), Invert(), Inverted(), DIALOG_COLOR_PICKER::OnChangeEditBlue(), DIALOG_COLOR_PICKER::onRGBMouseDrag(), KIGFX::operator==(), Saturate(), EDA_3D_VIEWER::Set3DColorFromUser(), DIALOG_COLOR_PICKER::SetEditVals(), KIGFX::CAIRO_GAL_BASE::SetFillColor(), DIALOG_COLOR_PICKER::setIconColor(), KIGFX::CAIRO_GAL_BASE::SetStrokeColor(), KIGFX::CAIRO_GAL_BASE::storePath(), ToHSL(), ToHSV(), and WithAlpha().

◆ BLACK

◆ g

double KIGFX::COLOR4D::g

Green component.

Definition at line 310 of file color4d.h.

Referenced by KIGFX::OPENGL_GAL::BitmapText(), KIGFX::OPENGL_GAL::blitCursor(), Brighten(), Brightened(), DIALOG_COLOR_PICKER::buttColorClick(), KIGFX::CAIRO_GAL_BASE::ChangeGroupColor(), KIGFX::VERTEX_MANAGER::ChangeItemColor(), KIGFX::OPENGL_COMPOSITOR::ClearBuffer(), KIGFX::CAIRO_GAL_BASE::ClearScreen(), KIGFX::VERTEX_MANAGER::Color(), COLOR4D(), CUSTOM_COLOR_ITEM::CUSTOM_COLOR_ITEM(), Darken(), Darkened(), KIGFX::OPENGL_GAL::DrawArc(), KIGFX::CAIRO_GAL_BASE::DrawArcSegment(), KIGFX::OPENGL_GAL::DrawArcSegment(), KIGFX::CAIRO_GAL_BASE::drawAxes(), KIGFX::OPENGL_GAL::drawBitmapOverbar(), KIGFX::OPENGL_GAL::DrawCircle(), KIGFX::OPENGL_GAL::DrawGrid(), KIGFX::CAIRO_GAL_BASE::drawGridCross(), KIGFX::CAIRO_GAL_BASE::drawGridLine(), KIGFX::CAIRO_GAL_BASE::drawGridPoint(), KIGFX::CAIRO_GAL_BASE::DrawGroup(), KIGFX::OPENGL_GAL::DrawLine(), KIGFX::OPENGL_GAL::drawPolygon(), KIGFX::OPENGL_GAL::drawPolyline(), KIGFX::OPENGL_GAL::DrawRectangle(), DIALOG_COLOR_PICKER::drawRGBPalette(), KIGFX::CAIRO_GAL_BASE::DrawSegment(), KIGFX::OPENGL_GAL::DrawSegment(), KIGFX::OPENGL_GAL::drawSemiCircle(), KIGFX::OPENGL_GAL::drawTriangulatedPolyset(), KIGFX::CAIRO_GAL_BASE::flushPath(), FromHSL(), FromHSV(), GetBrightness(), CINFO3D_VISU::GetColor(), getDXFColorName(), Invert(), Inverted(), DIALOG_COLOR_PICKER::OnChangeEditGreen(), DIALOG_COLOR_PICKER::onRGBMouseDrag(), KIGFX::operator==(), Saturate(), EDA_3D_VIEWER::Set3DColorFromUser(), DIALOG_COLOR_PICKER::SetEditVals(), KIGFX::CAIRO_GAL_BASE::SetFillColor(), DIALOG_COLOR_PICKER::setIconColor(), KIGFX::CAIRO_GAL_BASE::SetStrokeColor(), KIGFX::CAIRO_GAL_BASE::storePath(), ToHSL(), ToHSV(), and WithAlpha().

◆ r

double KIGFX::COLOR4D::r

Red component.

Definition at line 309 of file color4d.h.

Referenced by KIGFX::OPENGL_GAL::BitmapText(), KIGFX::OPENGL_GAL::blitCursor(), Brighten(), Brightened(), DIALOG_COLOR_PICKER::buttColorClick(), KIGFX::CAIRO_GAL_BASE::ChangeGroupColor(), KIGFX::VERTEX_MANAGER::ChangeItemColor(), KIGFX::OPENGL_COMPOSITOR::ClearBuffer(), KIGFX::CAIRO_GAL_BASE::ClearScreen(), KIGFX::VERTEX_MANAGER::Color(), COLOR4D(), CUSTOM_COLOR_ITEM::CUSTOM_COLOR_ITEM(), Darken(), Darkened(), KIGFX::OPENGL_GAL::DrawArc(), KIGFX::CAIRO_GAL_BASE::DrawArcSegment(), KIGFX::OPENGL_GAL::DrawArcSegment(), KIGFX::CAIRO_GAL_BASE::drawAxes(), KIGFX::OPENGL_GAL::drawBitmapOverbar(), KIGFX::OPENGL_GAL::DrawCircle(), KIGFX::OPENGL_GAL::DrawGrid(), KIGFX::CAIRO_GAL_BASE::drawGridCross(), KIGFX::CAIRO_GAL_BASE::drawGridLine(), KIGFX::CAIRO_GAL_BASE::drawGridPoint(), KIGFX::CAIRO_GAL_BASE::DrawGroup(), KIGFX::OPENGL_GAL::DrawLine(), KIGFX::OPENGL_GAL::drawPolygon(), KIGFX::OPENGL_GAL::drawPolyline(), KIGFX::OPENGL_GAL::DrawRectangle(), DIALOG_COLOR_PICKER::drawRGBPalette(), KIGFX::CAIRO_GAL_BASE::DrawSegment(), KIGFX::OPENGL_GAL::DrawSegment(), KIGFX::OPENGL_GAL::drawSemiCircle(), KIGFX::OPENGL_GAL::drawTriangulatedPolyset(), KIGFX::CAIRO_GAL_BASE::flushPath(), FromHSL(), FromHSV(), GetBrightness(), CINFO3D_VISU::GetColor(), getDXFColorName(), Invert(), Inverted(), DIALOG_COLOR_PICKER::OnChangeEditRed(), DIALOG_COLOR_PICKER::onRGBMouseDrag(), KIGFX::operator==(), Saturate(), EDA_3D_VIEWER::Set3DColorFromUser(), DIALOG_COLOR_PICKER::SetEditVals(), KIGFX::CAIRO_GAL_BASE::SetFillColor(), DIALOG_COLOR_PICKER::setIconColor(), KIGFX::CAIRO_GAL_BASE::SetStrokeColor(), KIGFX::CAIRO_GAL_BASE::storePath(), ToHSL(), ToHSV(), and WithAlpha().

◆ UNSPECIFIED

return COLOR4D::UNSPECIFIED
static

For legacy support; used as a value to indicate color hasn't been set yet.

Definition at line 315 of file color4d.h.

Referenced by COLOR4D().

◆ WHITE

const COLOR4D COLOR4D::WHITE
static

Definition at line 318 of file color4d.h.


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