diff --git a/main.py b/main.py index 28cf052..0b19699 100644 --- a/main.py +++ b/main.py @@ -3,9 +3,9 @@ from chroma_case.Note import Note import asyncio import sys -import board, neopixel +#import board, neopixel -pixels = neopixel.NeoPixel(board.D18, 20, brightness=0.1) +#pixels = neopixel.NeoPixel(board.D18, 20, brightness=0.1) notePixels = { 'si': [0, 1], 'la#': [2, 3], @@ -35,9 +35,15 @@ def hsl_to_rgb(hue, sat, light): else: t2 = light + sat - (light * sat) t1 = light * 2 - t2 - return (hue_to_rgb(t1, t2, hue + 2) * 255, - hue_to_rgb(t1, t2, hue) * 255, - hue_to_rgb(t1, t2, hue - 2) * 255) + + r = hue_to_rgb(t1, t2, hue + 2) * 255, + g = hue_to_rgb(t1, t2, hue) * 255, + b = hue_to_rgb(t1, t2, hue - 2) * 255 + return (round(r), round(g), round(b)) + +print(hsl_to_rgb()) + +pixels = {} async def to_chroma_case(data): global pixels