21 #ifndef _COLOR_SETTINGS_H 22 #define _COLOR_SETTINGS_H 116 std::unordered_map<int, COLOR4D>* aMap,
bool aReadOnly =
false ) :
127 ( *m_map )[
m_key ] = *optval;
128 else if( aResetIfMissing )
171 std::unordered_map<int, COLOR4D>*
m_map;
std::string m_path
the string used to store the param in json files
virtual ~COLOR_SETTINGS()
bool m_overrideSchItemColors
const wxString & GetName() const
COLOR4D GetDefault() const
OPT< ValueType > Get(const std::string &aPath) const
Fetches a value from within the JSON document.
COLOR_MAP_PARAM(const std::string &aJsonPath, int aMapKey, COLOR4D aDefault, std::unordered_map< int, COLOR4D > *aMap, bool aReadOnly=false)
void SetDefault() override
void SetOverrideSchItemColors(bool aFlag)
COLOR4D GetDefaultColor(int aLayer)
static std::vector< COLOR_SETTINGS * > CreateBuiltinColorSettings()
Constructs and returns a list of color settings objects based on the built-in color themes.
void SetName(const wxString &aName)
std::unordered_map< int, COLOR4D > m_defaultColors
void Store(JSON_SETTINGS *aSettings) const override
Stores the value of this parameter to the given JSON_SETTINGS object.
bool MatchesFile(JSON_SETTINGS *aSettings) const override
Checks whether the parameter in memory matches the one in a given JSON file.
std::vector< COLOR4D > m_Palette
m_Pallete stores a list of colors that are used, in order, when a list of colors needs to be generate...
COLOR4D GetColor(int aLayer) const
std::unordered_map< int, COLOR4D > m_colors
Map of all layer colors.
void initFromOther(const COLOR_SETTINGS &aOther)
COLOR_SETTINGS(wxString aFilename="user")
bool m_readOnly
! True if the parameter pointer should never be overwritten
COLOR_SETTINGS & operator=(const COLOR_SETTINGS &aOther)
std::unordered_map< int, COLOR4D > * m_map
bool MigrateFromLegacy(wxConfigBase *aCfg) override
Migrates from wxConfig to JSON-based configuration.
Color settings are a bit different than most of the settings objects in that there can be more than o...
bool GetOverrideSchItemColors() const
bool IsDefault() const override
Checks whether or not this param has been changed from its default value.
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...
void SetColor(int aLayer, COLOR4D aColor)
A color representation with 4 components: red, green, blue, alpha.
void Load(JSON_SETTINGS *aSettings, bool aResetIfMissing=true) const override
Loads the value of this parameter from JSON to the underlying storage.