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 ()
 
constexpr 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 Mix (const COLOR4D &aColor, double aFactor) const
 Function Mix Returns a color that is mixed with the input by a factor. 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:302
double b
Blue component.
Definition: color4d.h:303
double a
Alpha component.
Definition: color4d.h:304
double r
Red component.
Definition: color4d.h:301

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

◆ COLOR4D() [2/3]

constexpr 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:302
double b
Blue component.
Definition: color4d.h:303
double a
Alpha component.
Definition: color4d.h:304
double r
Red component.
Definition: color4d.h:301

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:302
static const COLOR4D UNSPECIFIED
For legacy support; used as a value to indicate color hasn't been set yet.
Definition: color4d.h:307
double b
Blue component.
Definition: color4d.h:303
double a
Alpha component.
Definition: color4d.h:304
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:301
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 146 of file color4d.h.

147  {
148  assert( aFactor >= 0.0 && aFactor <= 1.0 );
149 
150  r = r * ( 1.0 - aFactor ) + aFactor;
151  g = g * ( 1.0 - aFactor ) + aFactor;
152  b = b * ( 1.0 - aFactor ) + aFactor;
153 
154  return *this;
155  }
double g
Green component.
Definition: color4d.h:302
double b
Blue component.
Definition: color4d.h:303
double r
Red component.
Definition: color4d.h:301

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 199 of file color4d.h.

200  {
201  assert( aFactor >= 0.0 && aFactor <= 1.0 );
202 
203  return COLOR4D( r * ( 1.0 - aFactor ) + aFactor,
204  g * ( 1.0 - aFactor ) + aFactor,
205  b * ( 1.0 - aFactor ) + aFactor,
206  a );
207  }
double g
Green component.
Definition: color4d.h:302
double b
Blue component.
Definition: color4d.h:303
double a
Alpha component.
Definition: color4d.h:304
double r
Red component.
Definition: color4d.h:301

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

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

◆ 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 163 of file color4d.h.

164  {
165  assert( aFactor >= 0.0 && aFactor <= 1.0 );
166 
167  r = r * ( 1.0 - aFactor );
168  g = g * ( 1.0 - aFactor );
169  b = b * ( 1.0 - aFactor );
170 
171  return *this;
172  }
double g
Green component.
Definition: color4d.h:302
double b
Blue component.
Definition: color4d.h:303
double r
Red component.
Definition: color4d.h:301

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 215 of file color4d.h.

216  {
217  assert( aFactor >= 0.0 && aFactor <= 1.0 );
218 
219  return COLOR4D( r * ( 1.0 - aFactor ),
220  g * ( 1.0 - aFactor ),
221  b * ( 1.0 - aFactor ),
222  a );
223  }
double g
Green component.
Definition: color4d.h:302
double b
Blue component.
Definition: color4d.h:303
double a
Alpha component.
Definition: color4d.h:304
double r
Red component.
Definition: color4d.h:301

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 183 of file color4d.cpp.

184 {
185  const auto P = ( 1.0 - std::abs( 2.0 * aInLightness - 1.0 ) ) * aInSaturation;
186  const auto scaled_hue = aInHue / 60.0;
187  const auto Q = P * ( 1.0 - std::abs( std::fmod( scaled_hue, 2.0 ) - 1.0 ) );
188 
189  r = g = b = aInLightness - P / 2.0;
190 
191  if (scaled_hue < 1.0)
192  {
193  r += P;
194  g += Q;
195  }
196  else if (scaled_hue < 2.0)
197  {
198  r += Q;
199  g += P;
200  }
201  else if (scaled_hue < 3.0)
202  {
203  g += P;
204  b += Q;
205  }
206  else if (scaled_hue < 4.0)
207  {
208  g += Q;
209  b += P;
210  }
211  else if (scaled_hue < 5.0)
212  {
213  r += Q;
214  b += P;
215  }
216  else
217  {
218  r += P;
219  b += Q;
220  }
221 }
double g
Green component.
Definition: color4d.h:302
#define abs(a)
Definition: auxiliary.h:84
double b
Blue component.
Definition: color4d.h:303
double r
Red component.
Definition: color4d.h:301

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 277 of file color4d.cpp.

278 {
279  if( aInS <= 0.0 )
280  {
281  r = aInV;
282  g = aInV;
283  b = aInV;
284  return;
285  }
286 
287  double hh = aInH;
288 
289  while( hh >= 360.0 )
290  hh -= 360.0;
291 
292  /* Hue in degrees (0...360) is coded according to this table
293  * 0 or 360 : red
294  * 60 : yellow
295  * 120 : green
296  * 180 : cyan
297  * 240 : blue
298  * 300 : magenta
299  */
300  hh /= 60.0;
301 
302  int i = (int) hh;
303  double ff = hh - i;
304 
305  double p = aInV * ( 1.0 - aInS );
306  double q = aInV * ( 1.0 - ( aInS * ff ) );
307  double t = aInV * ( 1.0 - ( aInS * ( 1.0 - ff ) ) );
308 
309  switch( i )
310  {
311  case 0:
312  r = aInV;
313  g = t;
314  b = p;
315  break;
316 
317  case 1:
318  r = q;
319  g = aInV;
320  b = p;
321  break;
322 
323  case 2:
324  r = p;
325  g = aInV;
326  b = t;
327  break;
328 
329  case 3:
330  r = p;
331  g = q;
332  b = aInV;
333  break;
334 
335  case 4:
336  r = t;
337  g = p;
338  b = aInV;
339  break;
340 
341  case 5:
342  default:
343  r = aInV;
344  g = p;
345  b = q;
346  break;
347  }
348 }
double g
Green component.
Definition: color4d.h:302
double b
Blue component.
Definition: color4d.h:303
size_t i
Definition: json11.cpp:597
double r
Red component.
Definition: color4d.h:301

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 269 of file color4d.h.

270  {
271  // Weighted W3C formula
272  return r * 0.299 + g * 0.587 + b * 0.117;
273  }
double g
Green component.
Definition: color4d.h:302
double b
Blue component.
Definition: color4d.h:303
double r
Red component.
Definition: color4d.h:301

References b, g, and r.

Referenced by GRHaloText(), KIGFX::WS_RENDER_SETTINGS::IsBackgroundDark(), 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 179 of file color4d.h.

180  {
181  r = ( 1.0 - r );
182  g = ( 1.0 - g );
183  b = ( 1.0 - b );
184 
185  return *this;
186  }
double g
Green component.
Definition: color4d.h:302
double b
Blue component.
Definition: color4d.h:303
double r
Red component.
Definition: color4d.h:301

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 259 of file color4d.h.

260  {
261  return COLOR4D( 1.0 - r, 1.0 - g, 1.0 - b, a );
262  }
double g
Green component.
Definition: color4d.h:302
double b
Blue component.
Definition: color4d.h:303
double a
Alpha component.
Definition: color4d.h:304
double r
Red component.
Definition: color4d.h:301

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

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

◆ Mix()

COLOR4D KIGFX::COLOR4D::Mix ( const COLOR4D aColor,
double  aFactor 
) const
inline

Function Mix Returns a color that is mixed with the input by a factor.

Parameters
aFactorSpecifies how much of the original color to keep (valid values: 0.0 .. 1.0).
Returns
COLOR4D Mixed color.

Definition at line 231 of file color4d.h.

232  {
233  assert( aFactor >= 0.0 && aFactor <= 1.0 );
234 
235  return COLOR4D( aColor.r * ( 1.0 - aFactor ) + r * aFactor,
236  aColor.g * ( 1.0 - aFactor ) + g * aFactor,
237  aColor.b * ( 1.0 - aFactor ) + b * aFactor,
238  a );
239  }
double g
Green component.
Definition: color4d.h:302
double b
Blue component.
Definition: color4d.h:303
double a
Alpha component.
Definition: color4d.h:304
double r
Red component.
Definition: color4d.h:301

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

Referenced by KIGFX::RENDER_SETTINGS::update().

◆ Saturate()

COLOR4D & COLOR4D::Saturate ( double  aFactor)

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

Definition at line 351 of file color4d.cpp.

352 {
353  // One can saturate a color only when r, v, b are not equal
354  if( r == g && r == b )
355  return *this;
356 
357  double h, s, v;
358 
359  ToHSV( h, s, v, true );
360  FromHSV( h, aFactor, 1.0 );
361 
362  return *this;
363 }
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:224
double g
Green component.
Definition: color4d.h:302
double b
Blue component.
Definition: color4d.h:303
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:277
double r
Red component.
Definition: color4d.h:301

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 152 of file color4d.cpp.

153 {
154  auto min = std::min( r, std::min( g, b ) );
155  auto max = std::max( r, std::max( g, b ) );
156  auto diff = max - min;
157 
158  aOutLightness = ( max + min ) / 2.0;
159 
160  if( aOutLightness >= 1.0 )
161  aOutSaturation = 0.0;
162  else
163  aOutSaturation = diff / ( 1.0 - std::abs( 2.0 * aOutLightness - 1.0 ) );
164 
165  double hue;
166 
167  if( diff <= 0.0 )
168  hue = 0.0;
169  else if( max == r )
170  hue = ( g - b ) / diff;
171  else if( max == g )
172  hue = ( b - r ) / diff + 2.0;
173  else
174  hue = ( r - g ) / diff + 4.0;
175 
176  aOutHue = hue > 0.0 ? hue * 60.0 : hue * 60.0 + 360.0;
177 
178  while( aOutHue < 0.0 )
179  aOutHue += 360.0;
180 }
double g
Green component.
Definition: color4d.h:302
#define abs(a)
Definition: auxiliary.h:84
double b
Blue component.
Definition: color4d.h:303
#define max(a, b)
Definition: auxiliary.h:86
double r
Red component.
Definition: color4d.h:301
#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 224 of file color4d.cpp.

225 {
226  double min, max, delta;
227 
228  min = r < g ? r : g;
229  min = min < b ? min : b;
230 
231  max = r > g ? r : g;
232  max = max > b ? max : b;
233 
234  aOutValue = max; // value
235  delta = max - min;
236 
237  if( max > 0.0 )
238  {
239  aOutSaturation = ( delta / max );
240  }
241  else // for black color (r = g = b = 0 ) saturation is set to 0.
242  {
243  aOutSaturation = 0.0;
244  aOutHue = aAlwaysDefineHue ? 0.0 : NAN;
245  return;
246  }
247 
248  /* Hue in degrees (0...360) is coded according to this table
249  * 0 or 360 : red
250  * 60 : yellow
251  * 120 : green
252  * 180 : cyan
253  * 240 : blue
254  * 300 : magenta
255  */
256  if( delta != 0.0 )
257  {
258  if( r >= max )
259  aOutHue = ( g - b ) / delta; // between yellow & magenta
260  else if( g >= max )
261  aOutHue = 2.0 + ( b - r ) / delta; // between cyan & yellow
262  else
263  aOutHue = 4.0 + ( r - g ) / delta; // between magenta & cyan
264 
265  aOutHue *= 60.0; // degrees
266 
267  if( aOutHue < 0.0 )
268  aOutHue += 360.0;
269  }
270  else // delta = 0 means r = g = b. hue is set to 0.0
271  {
272  aOutHue = aAlwaysDefineHue ? 0.0 : NAN;
273  }
274 }
double g
Green component.
Definition: color4d.h:302
double b
Blue component.
Definition: color4d.h:303
#define max(a, b)
Definition: auxiliary.h:86
double r
Red component.
Definition: color4d.h:301
#define min(a, b)
Definition: auxiliary.h:85

References b, 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 247 of file color4d.h.

248  {
249  assert( aAlpha >= 0.0 && aAlpha <= 1.0 );
250 
251  return COLOR4D( r, g, b, aAlpha );
252  }
double g
Green component.
Definition: color4d.h:302
double b
Blue component.
Definition: color4d.h:303
double r
Red component.
Definition: color4d.h:301

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

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

Member Data Documentation

◆ a

double KIGFX::COLOR4D::a

Alpha component.

Definition at line 304 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(), Mix(), DIALOG_COLOR_PICKER::OnChangeAlpha(), 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 303 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(), Mix(), 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 302 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(), Mix(), 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 301 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(), Mix(), 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

constexpr COLOR4D COLOR4D::UNSPECIFIED
static

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

Definition at line 307 of file color4d.h.

Referenced by COLOR4D().

◆ WHITE

constexpr COLOR4D COLOR4D::WHITE
static

Definition at line 310 of file color4d.h.


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