27#include <wx/translation.h> 
   46                                                wxS( 
"KiCad Default" ) ) );
 
   52    wxASSERT( s_defaultTheme.count( y ) ); \ 
   53    m_params.emplace_back( new COLOR_MAP_PARAM( x, y, s_defaultTheme.at( y ), &m_colors ) ); 
  116            wxLogTrace( 
"colors", 
"Missing default color for gerbview layer %d", 
id );
 
  272                nlohmann::json::json_pointer ptr( 
"/board/via_hole" );
 
  285                for( std::string 
path : { 
"3d_viewer.background_top",
 
  286                                          "3d_viewer.background_bottom",
 
  288                                          "3d_viewer.silkscreen_top",
 
  289                                          "3d_viewer.silkscreen_bottom",
 
  290                                          "3d_viewer.solderpaste" } )
 
  293                        Set( 
path, optval->WithAlpha( 1.0 ) );
 
  302                if( std::optional<COLOR4D> optval = 
Get<COLOR4D>( 
"board.grid" ) )
 
  303                    Set( 
"board.page_limits",  *optval );
 
  305                if( std::optional<COLOR4D> optval = 
Get<COLOR4D>( 
"schematic.grid" ) )
 
  306                    Set( 
"schematic.page_limits", *optval );
 
 
  367        wxLogTrace( 
traceSettings, wxT( 
"Error: COLOR_SETTINGS migration cannot run unmanaged!" ) );
 
  374                    wxT( 
"migrateSchema0to1: %s doesn't have fpedit settings; skipping." ),
 
  379    wxString filename = 
GetFilename().BeforeLast( 
'.' ) + wxT( 
"_footprints" );
 
  388    fpsettings->
Set( 
"board", fpsettings->
At( 
"fpedit" ) );
 
  390    fpsettings->
Internals()->erase( 
"fpedit" );
 
  392    fpsettings->
SetName( fpsettings->
GetName() + wxS( 
" " ) + 
_( 
"(Footprints)" ) );
 
 
  421            if( cmp && cmp->
GetKey() == aLayer )
 
 
  446    defaultTheme->
SetName( 
_( 
"KiCad Default" ) );
 
  448    defaultTheme->
Load();   
 
  451    classicTheme->
SetName( 
_( 
"KiCad Classic" ) );
 
  460        classicTheme->
m_colors[entry.first] = entry.second;
 
  462    std::vector<COLOR_SETTINGS*> ret;
 
  464    ret.push_back( defaultTheme );
 
  465    ret.push_back( classicTheme );
 
 
static const std::vector< COLOR4D > s_userColors
 
static const std::map< int, COLOR4D > s_defaultTheme
 
static const std::vector< COLOR4D > s_copperColors
 
static const std::map< int, COLOR4D > s_classicTheme
 
static const COLOR4D UNSPECIFIED
For legacy support; used as a value to indicate color hasn't been set yet.
 
COLOR4D GetDefault() const
 
void SetName(const wxString &aName)
 
std::unordered_map< int, COLOR4D > m_defaultColors
 
void initFromOther(const COLOR_SETTINGS &aOther)
 
void SetColor(int aLayer, const COLOR4D &aColor)
 
static std::vector< COLOR_SETTINGS * > CreateBuiltinColorSettings()
Constructs and returns a list of color settings objects based on the built-in color themes.
 
bool MigrateFromLegacy(wxConfigBase *aCfg) override
Migrates from wxConfig to JSON-based configuration.
 
static const wxString COLOR_BUILTIN_CLASSIC
 
static const wxString COLOR_BUILTIN_DEFAULT
 
COLOR4D GetColor(int aLayer) const
 
COLOR4D GetDefaultColor(int aLayer)
 
COLOR_SETTINGS & operator=(const COLOR_SETTINGS &aOther)
 
std::unordered_map< int, COLOR4D > m_colors
Map of all layer colors.
 
bool m_overrideSchItemColors
 
COLOR_SETTINGS(const wxString &aFilename=wxT("user"), bool aAbsolutePath=false)
 
const wxString & GetName() const
 
void CloneFrom(const JSON_SETTINGS_INTERNALS &aOther)
 
void Set(const std::string &aPath, ValueType aVal)
Stores a value into the JSON document Will throw an exception if ValueType isn't something that the l...
 
wxString m_filename
The filename (not including path) of this settings file (inicode)
 
SETTINGS_MANAGER * m_manager
A pointer to the settings manager managing this file (may be null)
 
bool Contains(const std::string &aPath) const
 
SETTINGS_LOC GetLocation() const
 
void SetLocation(SETTINGS_LOC aLocation)
 
bool m_writeFile
Whether or not the backing store file should be written.
 
virtual void Load()
Updates the parameters of this object based on the current JSON document contents.
 
std::optional< ValueType > Get(const std::string &aPath) const
Fetches a value from within the JSON document.
 
std::vector< PARAM_BASE * > m_params
The list of parameters (owned by this object)
 
void registerMigration(int aOldSchemaVersion, int aNewSchemaVersion, std::function< bool(void)> aMigrator)
Registers a migration from one schema version to another.
 
nlohmann::json & At(const std::string &aPath)
Wrappers for the underlying JSON API so that most consumers don't need json.hpp All of these function...
 
JSON_SETTINGS_INTERNALS * Internals()
 
JSON_SETTINGS(const wxString &aFilename, SETTINGS_LOC aLocation, int aSchemaVersion)
 
std::unique_ptr< JSON_SETTINGS_INTERNALS > m_internals
 
wxString GetFilename() const
 
A color representation with 4 components: red, green, blue, alpha.
 
wxString ToCSSString() const
 
const int colorsSchemaVersion
! Update the schema version whenever a migration is required
 
@ COLORS
The color scheme directory (e.g. ~/.config/kicad/colors/)
 
@ NONE
No directory prepended, full path in filename (used for PROJECT_FILE)
 
PCB_LAYER_ID Map3DLayerToPCBLayer(int aLayer)
 
@ NETNAMES_LAYER_ID_START
 
@ LAYER_GERBVIEW_DRAWINGSHEET
 
@ GERBVIEW_LAYER_ID_START
 
@ LAYER_GERBVIEW_BACKGROUND
 
@ LAYER_GERBVIEW_PAGE_LIMITS
 
@ LAYER_3D_SOLDERMASK_TOP
 
@ LAYER_3D_BACKGROUND_TOP
 
@ LAYER_3D_SOLDERMASK_BOTTOM
 
@ LAYER_3D_SILKSCREEN_TOP
 
@ LAYER_3D_BACKGROUND_BOTTOM
 
@ LAYER_3D_SILKSCREEN_BOTTOM
 
bool IsCopperLayer(int aLayerId)
Test whether a layer is a copper layer.
 
@ LAYER_POINTS
PCB reference/manual snap points visibility.
 
@ LAYER_PAGE_LIMITS
Color for drawing the page extents (visibility stored in PCBNEW_SETTINGS::m_ShowPageLimits)
 
@ LAYER_LOCKED_ITEM_SHADOW
Shadow layer for locked items.
 
@ LAYER_CONFLICTS_SHADOW
Shadow layer for items flagged conflicting.
 
@ LAYER_NON_PLATEDHOLES
Draw usual through hole vias.
 
@ LAYER_DRAWINGSHEET
Sheet frame and title block.
 
@ LAYER_BOARD_OUTLINE_AREA
PCB board outline.
 
@ LAYER_DRC_EXCLUSION
Layer for DRC markers which have been individually excluded.
 
@ LAYER_PCB_BACKGROUND
PCB background color.
 
@ LAYER_DRC_WARNING
Layer for DRC markers with #SEVERITY_WARNING.
 
@ LAYER_PAD_PLATEDHOLES
to draw pad holes (plated)
 
@ LAYER_CURSOR
PCB cursor.
 
@ LAYER_AUX_ITEMS
Auxiliary items (guides, rule, etc).
 
@ LAYER_ANCHOR
Anchor of items having an anchor point (texts, footprints).
 
@ LAYER_VIA_HOLES
Draw via holes (pad holes do not use this layer).
 
@ LAYER_DRC_ERROR
Layer for DRC markers with #SEVERITY_ERROR.
 
@ LAYER_EXCLUDED_FROM_SIM
 
@ LAYER_DEVICE_BACKGROUND
 
@ LAYER_SCHEMATIC_DRAWINGSHEET
 
@ LAYER_SCHEMATIC_GRID_AXES
 
@ LAYER_SCHEMATIC_PAGE_LIMITS
 
@ LAYER_DRAG_NET_COLLISION
 
@ LAYER_SELECTION_SHADOWS
 
@ LAYER_SCHEMATIC_BACKGROUND
 
@ LAYER_SCHEMATIC_AUX_ITEMS
 
PCB_LAYER_ID
A quick note on layer IDs:
 
#define GERBER_DRAWLAYERS_COUNT
Number of draw layers in Gerbview.