Skip to content

Commit

Permalink
python script to extract colors from https://gist.githubusercontent.c…
Browse files Browse the repository at this point in the history
  • Loading branch information
nilsreiter committed Sep 22, 2024
1 parent 298e48d commit dc15870
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions convert.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import json

f = open("scenes.json")
obj = json.load(f)

d = {}
l = []

for scene_set in obj["sets"]:
set_name = scene_set["name"]
for scene in scene_set["scenes"]:
scene_name = scene["name"]
bri = scene["bri"]
lights = [ [l["x"],l["y"]] for l in scene["lights"]]
s = { "c": lights, "b": round(bri/255, 3), "s": set_name }
d[scene_name] = s
l.append(set_name + ": " + scene_name)

print(json.dumps(d, separators=(',', ':')))

l.sort()

for s in l:
print(f"- \"{s}\"")

0 comments on commit dc15870

Please sign in to comment.