summaryrefslogtreecommitdiff
path: root/tools/themer.py
diff options
context:
space:
mode:
authorDaniel Thompson <daniel@redfelineninja.org.uk>2020-12-31 10:09:38 (GMT)
committerDaniel Thompson <daniel@redfelineninja.org.uk>2020-12-31 10:09:38 (GMT)
commit1eada36ff4953cb6b52e249c2908e5c74a7917d1 (patch)
tree1dff459382394d80aef55ee7ea73b4987199e873 /tools/themer.py
parent6212a6275a2678f9512656c450a7ffa9ef14c084 (diff)
wasp: manager: Byte-swap the theme encoding
Currently the theme is explicitly little endian. This does match the underlying hardware but makes it needlessly difficult to hand edit themes. Switch the default theme and theming tools over to big endian form and add comments to the default theme to support hand editing. We also expand the ASCII characters in the default them with hex codes. This is the final step needed to make hand edited themes trivial to work with. Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Diffstat (limited to 'tools/themer.py')
-rwxr-xr-xtools/themer.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/themer.py b/tools/themer.py
index 622142f..9eee132 100755
--- a/tools/themer.py
+++ b/tools/themer.py
@@ -25,7 +25,7 @@ class DefaultTheme():
def serialize(self) -> bytes:
"""Serializes the theme for use in wasp-os"""
def split_bytes(x: int) -> Tuple[int, int]:
- return (x & 0xFF, (x >> 8) & 0xFF)
+ return ((x >> 8) & 0xFF, x & 0xFF)
theme_bytes = bytes([
*split_bytes(self.BLE_COLOR),
*split_bytes(self.SCROLL_INDICATOR_COLOR),