KiCad PCB EDA Suite
color4d.cpp File Reference
#include <map>
#include <nlohmann/json.hpp>
#include <gal/color4d.h>
#include <i18n_utility.h>

Go to the source code of this file.

Namespaces

 KIGFX
 Class CAIRO_GAL is the cairo implementation of the graphics abstraction layer.
 

Macros

#define TS(string)   wxString( _HKI( string ) ).ToStdString()
 

Functions

const StructColorscolorRefs ()
 Global list of legacy color names, still used all over the place for constructing COLOR4D's. More...
 
const bool KIGFX::operator== (const COLOR4D &lhs, const COLOR4D &rhs)
 Equality operator, are two colors equal. More...
 
const bool KIGFX::operator!= (const COLOR4D &lhs, const COLOR4D &rhs)
 Not equality operator, are two colors not equal. More...
 
const bool KIGFX::operator< (const COLOR4D &lhs, const COLOR4D &rhs)
 
std::ostream & KIGFX::operator<< (std::ostream &aStream, COLOR4D const &aColor)
 Syntactic sugar for outputting colors to strings. More...
 
void KIGFX::to_json (nlohmann::json &aJson, const COLOR4D &aColor)
 
void KIGFX::from_json (const nlohmann::json &aJson, COLOR4D &aColor)
 

Macro Definition Documentation

◆ TS

#define TS (   string)    wxString( _HKI( string ) ).ToStdString()

Definition at line 33 of file color4d.cpp.

Function Documentation

◆ colorRefs()

const StructColors* colorRefs ( )

Global list of legacy color names, still used all over the place for constructing COLOR4D's.

Definition at line 37 of file color4d.cpp.

38 {
39  static StructColors s_ColorRefs[NBCOLORS] =
40  {
41  { 0, 0, 0, BLACK, TS( "Black" ), DARKDARKGRAY },
42  { 72, 72, 72, DARKDARKGRAY, TS( "Gray 1" ), DARKGRAY },
43  { 132, 132, 132, DARKGRAY, TS( "Gray 2" ), LIGHTGRAY },
44  { 194, 194, 194, LIGHTGRAY, TS( "Gray 3" ), WHITE },
45  { 255, 255, 255, WHITE, TS( "White" ), WHITE },
46  { 194, 255, 255, LIGHTYELLOW, TS( "L.Yellow" ), WHITE },
47  { 72, 0, 0, DARKBLUE, TS( "Blue 1" ), BLUE },
48  { 0, 72, 0, DARKGREEN, TS( "Green 1" ), GREEN },
49  { 72, 72, 0, DARKCYAN, TS( "Cyan 1" ), CYAN },
50  { 0, 0, 72, DARKRED, TS( "Red 1" ), RED },
51  { 72, 0, 72, DARKMAGENTA, TS( "Magenta 1" ), MAGENTA },
52  { 0, 72, 72, DARKBROWN, TS( "Brown 1" ), BROWN },
53  { 132, 0, 0, BLUE, TS( "Blue 2" ), LIGHTBLUE },
54  { 0, 132, 0, GREEN, TS( "Green 2" ), LIGHTGREEN },
55  { 132, 132, 0, CYAN, TS( "Cyan 2" ), LIGHTCYAN },
56  { 0, 0, 132, RED, TS( "Red 2" ), LIGHTRED },
57  { 132, 0, 132, MAGENTA, TS( "Magenta 2" ), LIGHTMAGENTA },
58  { 0, 132, 132, BROWN, TS( "Brown 2" ), YELLOW },
59  { 194, 0, 0, LIGHTBLUE, TS( "Blue 3" ), PUREBLUE, },
60  { 0, 194, 0, LIGHTGREEN, TS( "Green 3" ), PUREGREEN },
61  { 194, 194, 0, LIGHTCYAN, TS( "Cyan 3" ), PURECYAN },
62  { 0, 0, 194, LIGHTRED, TS( "Red 3" ), PURERED },
63  { 194, 0, 194, LIGHTMAGENTA, TS( "Magenta 3" ), PUREMAGENTA },
64  { 0, 194, 194, YELLOW, TS( "Yellow 3" ), PUREYELLOW },
65  { 255, 0, 0, PUREBLUE, TS( "Blue 4" ), WHITE },
66  { 0, 255, 0, PUREGREEN, TS( "Green 4" ), WHITE },
67  { 255, 255, 0, PURECYAN, TS( "Cyan 4" ), WHITE },
68  { 0, 0, 255, PURERED, TS( "Red 4" ), WHITE },
69  { 255, 0, 255, PUREMAGENTA, TS( "Magenta 4" ), WHITE },
70  { 0, 255, 255, PUREYELLOW, TS( "Yellow 4" ), WHITE },
71  };
72  return s_ColorRefs;
73 }
Definition: color4d.h:61
Definition: color4d.h:44
Number of colors.
Definition: color4d.h:74
Definition: color4d.h:67
Definition: color4d.h:57
Definition: color4d.h:58
Definition: color4d.h:59
Definition: color4d.h:48
Definition: color4d.h:56
#define TS(string)
Definition: color4d.cpp:33

References BLACK, BLUE, BROWN, CYAN, DARKBLUE, DARKBROWN, DARKCYAN, DARKDARKGRAY, DARKGRAY, DARKGREEN, DARKMAGENTA, DARKRED, GREEN, LIGHTBLUE, LIGHTCYAN, LIGHTGRAY, LIGHTGREEN, LIGHTMAGENTA, LIGHTRED, LIGHTYELLOW, MAGENTA, NBCOLORS, PUREBLUE, PURECYAN, PUREGREEN, PUREMAGENTA, PURERED, PUREYELLOW, RED, TS, WHITE, and YELLOW.

Referenced by KIGFX::COLOR4D::COLOR4D(), KIGFX::COLOR4D::FindNearestLegacyColor(), and DIALOG_COLOR_PICKER::initDefinedColors().