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 (C) 2016-2023 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, you may find one here:
19 * https://www.gnu.org/licenses/gpl-3.0.html
20 * or you may search the http://www.gnu.org website for the version 3 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
25#ifndef __SIM_PLOT_COLORS__
26#define __SIM_PLOT_COLORS__
27
28
29#include <map>
30#include <vector>
31#include <wx/colour.h>
32#include <wx/string.h>
33
34
35class TRACE;
36
43{
44public:
47
48 // Identifiers (indexes) for color choice in color table
49 enum class COLOR_SET
50 {
53 AXIS,
54 TRACE // First index for trace colors list
55 };
56
61 wxColour GetPlotColor( enum COLOR_SET aColorId );
62
67 wxColour GenerateColor( std::map<wxString, wxColour> aTraceColors );
68
74 static void FillDefaultColorList( bool aWhiteBg );
75
76private:
80 enum COLOR_SET getPlotColorCount() { return static_cast<enum COLOR_SET>( m_colorList.size() ); }
81
82private:
84 static std::vector<wxColour> m_colorList;
85
86};
87
90inline bool operator<( SIM_PLOT_COLORS::COLOR_SET& x, int y );
91inline bool operator>=( SIM_PLOT_COLORS::COLOR_SET& x, int y );
98
99
100#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)