Revert "Add support for all RGB color order permutations (RGB, RBG, GRB, GBR, BRG, BGR)"

This reverts commit f53c57f036.
This commit is contained in:
2025-11-30 18:34:32 +13:00
parent f53c57f036
commit 6ae6189519
2 changed files with 9 additions and 28 deletions

View File

@@ -9,21 +9,8 @@ class Settings(dict):
def __init__(self):
super().__init__()
self.load() # Load settings from file during initialization
self.color_order = self._get_color_order(self.get("color_order", "rgb"))
def _get_color_order(self, order):
"""Convert color order string to tuple of hex string indices.
Hex string format: #RRGGBB where indices are 1, 3, 5 (0-indexed).
Returns tuple (R_index, G_index, B_index) for hex string parsing."""
color_orders = {
"rgb": (1, 3, 5), # Red at 1, Green at 3, Blue at 5
"rbg": (1, 5, 3), # Red at 1, Blue at 5, Green at 3
"grb": (3, 1, 5), # Green at 3, Red at 1, Blue at 5
"gbr": (3, 5, 1), # Green at 3, Blue at 5, Red at 1
"brg": (5, 1, 3), # Blue at 5, Red at 1, Green at 3
"bgr": (5, 3, 1), # Blue at 5, Green at 3, Red at 1
}
return color_orders.get(order.lower(), (1, 3, 5)) # Default to RGB
if self["color_order"] == "rbg": self.color_order = (1, 5, 3)
else: self.color_order = (1, 3, 5)
def set_defaults(self):
self["led_pin"] = 10
@@ -97,7 +84,8 @@ class Settings(dict):
self.save()
machine.reset()
elif key == "color_order":
self.color_order = self._get_color_order(value)
if value == "rbg": self.color_order = (1, 5, 3)
else: self.color_order = (1, 3, 5)
pass
elif key == "id":
pass