[nostalgia/core] Finish removing alpha bit from color

This commit is contained in:
2021-02-02 19:22:43 -06:00
parent 983a9b87d5
commit ba4a854368
4 changed files with 9 additions and 10 deletions
+2 -2
View File
@@ -277,7 +277,7 @@ void PaletteEditor::addTableRow(int i, Color16 c) {
m_table->setItem(i, 0, mkCell(red16(c)));
m_table->setItem(i, 1, mkCell(green16(c)));
m_table->setItem(i, 2, mkCell(blue16(c)));
m_table->setItem(i, 3, mkCell(toQColor(m_pal->colors[static_cast<std::size_t>(i)]).name(QColor::HexArgb), false));
m_table->setItem(i, 3, mkCell(toQColor(m_pal->colors[static_cast<std::size_t>(i)]).name(QColor::HexRgb), false));
connect(m_table, &QTableWidget::cellChanged, this, &PaletteEditor::cellChanged);
}
@@ -292,7 +292,7 @@ void PaletteEditor::setTableRow(int idx, Color16 c) {
m_table->item(idx, 0)->setText(QString::number(red16(c)));
m_table->item(idx, 1)->setText(QString::number(green16(c)));
m_table->item(idx, 2)->setText(QString::number(blue16(c)));
m_table->item(idx, 3)->setText(toQColor(m_pal->colors[static_cast<std::size_t>(idx)]).name(QColor::HexArgb));
m_table->item(idx, 3)->setText(toQColor(m_pal->colors[static_cast<std::size_t>(idx)]).name(QColor::HexRgb));
connect(m_table, &QTableWidget::cellChanged, this, &PaletteEditor::cellChanged);
}
@@ -279,7 +279,7 @@ class UpdatePixelsCommand: public QUndoCommand {
m_cmdIdx = cmdIdx;
PixelUpdate pu;
pu.item = pixelItem;
pu.oldColorId = m_palette.indexOf(pixelItem->property("color").value<QColor>().name(QColor::HexArgb));
pu.oldColorId = m_palette.indexOf(pixelItem->property("color").value<QColor>().name(QColor::HexRgb));
m_pixelUpdates.insert(pu);
setObsolete(pu.oldColorId == newColorId);
}
@@ -585,7 +585,7 @@ void SheetData::setPalette(const NostalgiaPalette *npal) {
m_palette.clear();
for (std::size_t i = 0; i < npal->colors.size(); i++) {
const auto c = toQColor(npal->colors[i]);
const auto color = c.name(QColor::HexArgb);
const auto color = c.name(QColor::HexRgb);
m_palette.append(color);
}
emit paletteChanged();