Skip to content

Commit

Permalink
(rv) 2cc remap helper function
Browse files Browse the repository at this point in the history
  • Loading branch information
ahyangyi committed Oct 7, 2023
1 parent 13dd3c2 commit 5e3ae53
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions agrf/graphics/palette.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import json
from .recolour import ColourMap, ColourRange

with open("files/ttd_palette.json") as f:
PALETTE = json.load(f)["entries"]
Expand All @@ -21,3 +22,11 @@ class CompanyColour:
BROWN = 0x20
GREY = 0x4
WHITE = 0x8


def company_colour_remap(cc1, cc2):
return ColourMap(
f"cc{cc1}_{cc2}",
[(ColourRange(CompanyColour.DARK_BLUE + 2, CompanyColour.DARK_BLUE + 9), ColourRange(cc1 + 2, cc1 + 9))],
[(ColourRange(CompanyColour.PALE_GREEN + 2, CompanyColour.PALE_GREEN + 9), ColourRange(cc2 + 2, cc2 + 9))],
)

0 comments on commit 5e3ae53

Please sign in to comment.