Mercurial > hg > tilerswift
changeset 76:f311c18ef557
colour: start a list of default palettes
I'm thinking palettes called Mario, Megaman, Link...
author | Jordi Gutiérrez Hermoso <jordigh@octave.org> |
---|---|
date | Tue, 10 Sep 2019 13:01:53 -0400 |
parents | 66773b576282 |
children | cc5ffdcf7108 |
files | colors.py tilerswift |
diffstat | 2 files changed, 8 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/colors.py +++ b/colors.py @@ -71,6 +71,12 @@ ] QT_NES_PALETTE = [QG.QColor(color).rgb() for color in NES_PALETTE] + +TILE_PALETTES = { + "Megaman": [32, 15, 33, 1], +} + + def palette_to_qt(palette): return [ QG.QColor(0, 0, 0, 0).rgba() if color_idx is None
--- a/tilerswift +++ b/tilerswift @@ -3,7 +3,7 @@ from PyQt5 import QtCore as QC, QtGui as QG, QtWidgets as QW -from colors import NES_PALETTE, palette_to_qt +from colors import NES_PALETTE, TILE_PALETTES, palette_to_qt class NES_ROM(object): @@ -35,12 +35,7 @@ class Tile(object): # Mega Man colours - default_palette = [ - 32, - 15, - 33, - 1, - ] + default_palette = TILE_PALETTES["Megaman"] def __init__(self, raw_tile): super().__init__()