Undo minor changes (noise)

This commit is contained in:
elpekenin 2024-03-10 11:30:09 +01:00
parent e00a99f041
commit 57f8d08f01
2 changed files with 3 additions and 5 deletions

View File

@ -3,7 +3,6 @@
import datetime import datetime
import math import math
import re import re
import sys
from string import Template from string import Template
from PIL import Image, ImageOps from PIL import Image, ImageOps
@ -401,7 +400,7 @@ def compress_bytes_qmk_rle(bytearray):
output.extend(r) output.extend(r)
for n in range(0, len(bytearray) + 1): for n in range(0, len(bytearray) + 1):
end = n == len(bytearray) end = True if n == len(bytearray) else False
if not end: if not end:
c = bytearray[n] c = bytearray[n]
temp.append(c) temp.append(c)
@ -423,7 +422,7 @@ def compress_bytes_qmk_rle(bytearray):
if len(temp) >= 2 and temp[-1] == temp[-2]: if len(temp) >= 2 and temp[-1] == temp[-2]:
repeat = True repeat = True
if len(temp) > 2: if len(temp) > 2:
append_range(temp[:len(temp) - 2]) append_range(temp[0:(len(temp) - 2)])
temp = [temp[-1], temp[-1]] temp = [temp[-1], temp[-1]]
continue continue
if len(temp) == 128 or end: if len(temp) == 128 or end:

View File

@ -17,9 +17,8 @@ def o24(i):
return o16(i & 0xFFFF) + o8((i & 0xFF0000) >> 16) return o16(i & 0xFFFF) + o8((i & 0xFF0000) >> 16)
# Helper to convert from RGB888 to the QMK "dialect" of HSV888
def rgb888_to_qmk_hsv888(e): def rgb888_to_qmk_hsv888(e):
"""Helper to convert from RGB888 to the QMK "dialect" of HSV888
"""
hsv = rgb_to_hsv(e[0] / 255.0, e[1] / 255.0, e[2] / 255.0) hsv = rgb_to_hsv(e[0] / 255.0, e[1] / 255.0, e[2] / 255.0)
return (int(hsv[0] * 255.0), int(hsv[1] * 255.0), int(hsv[2] * 255.0)) return (int(hsv[0] * 255.0), int(hsv[1] * 255.0), int(hsv[2] * 255.0))