(sprito.py) Constant colors and pallet

This commit is contained in:
KikooDX 2020-04-12 17:46:30 +02:00
parent 30ba1948dc
commit 0e72a3c3c3
1 changed files with 22 additions and 1 deletions

View File

@ -1,4 +1,4 @@
from casioplot import set_pixel, get_pixel
from casioplot import *
class SpriteIndexed:
def __init__(self, w: int, h: int, data):
@ -52,3 +52,24 @@ def invert_rect(x: int, y: int, w: int, h: int) -> None:
for i in range(x, x + w):
for j in range(y, y + h):
invert_pixel(i, j)
#color constants
C_BLACK = (0,0,0)
C_WHITE = (255,255,255)
C_RED = (255,0,0)
C_GREEN = (0,255,0)
C_BLUE = (0,0,255)
C_YELLOW = (255,255,0)
C_PURPLE = (255,0,255)
C_CYAN = (0,255,255)
#standard pallet
PALLET = {
'd': C_BLACK,
'w': C_WHITE,
'r': C_RED,
'g': C_GREEN,
'b': C_BLUE,
'y': C_YELLOW,
'p': C_PURPLE,
'c': C_CYAN
}