KiCad PCB EDA Suite
class_colors_design_settings.h
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2016 Jean-Pierre Charras, jp.charras at wanadoo.fr
5  * Copyright (C) 2016 KiCad Developers, see CHANGELOG.TXT for contributors.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
30 #ifndef COLORS_DESIGN_SETTING_H
31 #define COLORS_DESIGN_SETTING_H
32 #include <gal/color4d.h>
34 #include <core/settings.h>
35 
36 using KIGFX::COLOR4D;
37 
38 class wxConfigBase;
39 class wxString;
40 
41 class PARAM_CFG_ARRAY;
42 
48 {
49 public:
50  // Color options for screen display of the Printed Board and schematic:
51 
52  // Common to Eeschema, Pcbnew, GerbView
54 
55 public:
57 
59  {}
60 
61  virtual void Load( wxConfigBase *aConfig ) override;
62  virtual void Save( wxConfigBase *aConfig ) override;
68  COLOR4D GetLayerColor( LAYER_NUM aLayer ) const;
69 
75  void SetLayerColor( LAYER_NUM aLayer, COLOR4D aColor );
76 
82  COLOR4D GetItemColor( int aItemIdx ) const;
83 
89  void SetItemColor( int aItemIdx, COLOR4D aColor );
90 
96  void SetAllColorsAs( COLOR4D aColor );
97 
98 private:
99 
100  void setupConfigParams();
101 
102 };
103 
104 #endif // COLORS_DESIGN_SETTING_H
A list of parameters type.
void SetItemColor(int aItemIdx, COLOR4D aColor)
Function SetItemColor sets the color for an item which is one of the item indices given in enum PCB_L...
Class TOOL_SETTINGS.
Definition: settings.h:38
void SetLayerColor(LAYER_NUM aLayer, COLOR4D aColor)
Function SetLayerColor sets the color for aLayer which is one of the layer indices given in pcbstruct...
virtual void Save(wxConfigBase *aConfig) override
COLOR4D GetItemColor(int aItemIdx) const
Function GetItemColor.
COLOR4D m_LayersColors[LAYER_ID_COUNT]
Layer colors (tracks and graphic items)
void SetAllColorsAs(COLOR4D aColor)
Function SetAllColorsAs sets alls colors to aColor Usefull to create a monochrome color selection for...
#define LAYER_ID_COUNT
Must update this if you add any enums after GerbView!
int LAYER_NUM
Type LAYER_NUM can be replaced with int and removed.
virtual void Load(wxConfigBase *aConfig) override
Board layer functions and definitions.
COLOR4D GetLayerColor(LAYER_NUM aLayer) const
Function GetLayerColor.
Class COLORS_DESIGN_SETTINGS is a list of color settings for designs in Eeschema, Pcbnew and GerbView...
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39