--- a/src/colors.h Sun Jan 19 14:25:57 2020 +0200 +++ b/src/colors.h Wed Jan 22 00:23:29 2020 +0200 @@ -17,6 +17,7 @@ */ #pragma once +#include <QColor> #include "main.h" struct Color @@ -24,6 +25,24 @@ qint32 index; }; +class ColorTable +{ +public: + struct ColorDefinition + { + QColor faceColor; + QColor edgeColor; + QString name; + }; + void clear(); + Result load(QIODevice& device, QTextStream& errors); + const ColorDefinition& operator[](Color index) const; + static const ColorDefinition unknownColor; +private: + void loadColorFromString(const QString& string); + QMap<qint32, ColorDefinition> definitions; +}; + inline bool operator==(const Color& one, const Color& other) { return one.index == other.index;