10 #include <QCoreApplication>
27 QColor(Qt::darkMagenta), QColor(Qt::darkRed), QColor(Qt::darkGreen),
28 QColor(Qt::darkCyan), QColor(
"#0000A0"), QColor(
"#FF8000"),
29 QColor(
"#8000FF"), QColor(
"#FF0080"), QColor(
Qt::white),
30 QColor(Qt::lightGray), QColor(Qt::gray), QColor(
"#FFFF80"),
31 QColor(
"#80FFFF"), QColor(
"#FF80FF"), QColor(Qt::darkGray),
47 QList<QColor> indexedColors =
colorList();
50 QPixmap icon = QPixmap(28, 16);
51 QRect r = QRect(0, 0, 27, 15);
56 for (
int i = 0; i < indexedColors.size(); i++) {
57 p.setBrush(QBrush(indexedColors[i]));
59 this->addItem(icon, color_names[i]);
108 QSettings settings(QCoreApplication::applicationDirPath() +
"\\config.ini",
109 QSettings::IniFormat);
111 settings.beginGroup(
"/General");
113 QList<QColor> indexedColors;
114 QStringList lst = settings.value(
"/IndexedColors").toStringList();
115 if (!lst.isEmpty()) {
116 for (
int i = 0; i < lst.size(); i++) indexedColors << QColor(lst[i]);
122 return indexedColors;
130 QSettings settings(QCoreApplication::applicationDirPath() +
"\\config.ini",
131 QSettings::IniFormat);
133 settings.beginGroup(
"/General");
134 QStringList color_names =
174 QStringList color_names = QStringList() << tr(
"black");
175 color_names << tr(
"red");
176 color_names << tr(
"green");
177 color_names << tr(
"blue");
178 color_names << tr(
"cyan");
179 color_names << tr(
"magenta");
180 color_names << tr(
"yellow");
181 color_names << tr(
"dark yellow");
182 color_names << tr(
"navy");
183 color_names << tr(
"purple");
184 color_names << tr(
"wine");
185 color_names << tr(
"olive");
186 color_names << tr(
"dark cyan");
187 color_names << tr(
"royal");
188 color_names << tr(
"orange");
189 color_names << tr(
"violet");
190 color_names << tr(
"pink");
191 color_names << tr(
"white");
192 color_names << tr(
"light gray");
193 color_names << tr(
"gray");
194 color_names << tr(
"light yellow");
195 color_names << tr(
"light cyan");
196 color_names << tr(
"light magenta");
197 color_names << tr(
"dark gray");
constexpr Rgb cyan(0, MAX, MAX)
constexpr Rgb black(0, 0, 0)
constexpr Rgb magenta(MAX, 0, MAX)
constexpr Rgb darkBlue(0, 0, MAX/2)
constexpr Rgb white(MAX, MAX, MAX)
constexpr Rgb red(MAX, 0, 0)
constexpr Rgb blue(0, 0, MAX)
constexpr Rgb green(0, MAX, 0)
constexpr Rgb yellow(MAX, MAX, 0)