KiCad PCB EDA Suite
Loading...
Searching...
No Matches
sim_plot_colors.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) 2021 Sylwester Kocjan <[email protected]>
5 * Copyright The KiCad Developers, see AUTHORS.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 3
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, see <https://www.gnu.org/licenses/>.
19 */
20
21#ifndef __SIM_PLOT_COLORS__
22#define __SIM_PLOT_COLORS__
23
24
25#include <map>
26#include <vector>
27#include <wx/colour.h>
28#include <wx/string.h>
29
30
31class TRACE;
32
39{
40public:
43
44 // Identifiers (indexes) for color choice in color table
45 enum class COLOR_SET
46 {
50 TRACE // First index for trace colors list
51 };
52
57 wxColour GetPlotColor( enum COLOR_SET aColorId );
58
63 wxColour GenerateColor( std::map<wxString, wxColour> aTraceColors );
64
70 static void FillDefaultColorList( bool aWhiteBg );
71
72private:
76 enum COLOR_SET getPlotColorCount() { return static_cast<enum COLOR_SET>( m_colorList.size() ); }
77
78private:
80 static std::vector<wxColour> m_colorList;
81
82};
83
86inline bool operator<( SIM_PLOT_COLORS::COLOR_SET& x, int y );
87inline bool operator>=( SIM_PLOT_COLORS::COLOR_SET& x, int y );
94
95
96#endif // __SIM_PLOT_COLORS__
wxColour GetPlotColor(enum COLOR_SET aColorId)
enum COLOR_SET getPlotColorCount()
static std::vector< wxColour > m_colorList
< The color list to draw traces, bg, fg, axis...
static void FillDefaultColorList(bool aWhiteBg)
Fills m_colorList by a default set of colors.
wxColour GenerateColor(std::map< wxString, wxColour > aTraceColors)
bool operator<(SIM_PLOT_COLORS::COLOR_SET &x, SIM_PLOT_COLORS::COLOR_SET &y)
bool operator>=(SIM_PLOT_COLORS::COLOR_SET &x, SIM_PLOT_COLORS::COLOR_SET &y)
SIM_PLOT_COLORS::COLOR_SET & operator++(SIM_PLOT_COLORS::COLOR_SET &x)
SIM_PLOT_COLORS::COLOR_SET operator+(SIM_PLOT_COLORS::COLOR_SET x, SIM_PLOT_COLORS::COLOR_SET y)
SIM_PLOT_COLORS::COLOR_SET operator%(int x, SIM_PLOT_COLORS::COLOR_SET y)
SIM_PLOT_COLORS::COLOR_SET operator-(SIM_PLOT_COLORS::COLOR_SET x, SIM_PLOT_COLORS::COLOR_SET y)