allow to change color in interactive mode
Signed-off-by: Thomas Schmid <tom@lfence.de>
This commit is contained in:
parent
5b9b69e440
commit
3ebdfc93e5
16
main.py
16
main.py
|
@ -66,8 +66,10 @@ def interactive(an, config):
|
||||||
|
|
||||||
x = 0
|
x = 0
|
||||||
y = 0
|
y = 0
|
||||||
|
color_keys = list(COLORS.keys())
|
||||||
|
c = 0
|
||||||
|
|
||||||
set_color(an, 0x100)
|
set_color(an, COLORS[color_keys[c]])
|
||||||
|
|
||||||
print_pos = lambda x,y: print(f"x:{x} y:{y}")
|
print_pos = lambda x,y: print(f"x:{x} y:{y}")
|
||||||
|
|
||||||
|
@ -84,6 +86,16 @@ def interactive(an, config):
|
||||||
if keyboard.is_pressed("d"):
|
if keyboard.is_pressed("d"):
|
||||||
y = y + 1
|
y = y + 1
|
||||||
print_pos(x,y)
|
print_pos(x,y)
|
||||||
|
if keyboard.is_pressed(" "):
|
||||||
|
pass
|
||||||
|
#save point in config file
|
||||||
|
if keyboard.is_pressed("c"):
|
||||||
|
c = c + 1
|
||||||
|
if c >= len(color_keys):
|
||||||
|
c = 0
|
||||||
|
|
||||||
|
set_color(an, COLORS[color_keys[c]])
|
||||||
|
|
||||||
|
|
||||||
set_pos(an, (x, y))
|
set_pos(an, (x, y))
|
||||||
time.sleep(0.05)
|
time.sleep(0.05)
|
||||||
|
@ -115,7 +127,7 @@ def main(args):
|
||||||
c = random.choice(list(COLORS.values()))
|
c = random.choice(list(COLORS.values()))
|
||||||
else:
|
else:
|
||||||
c = COLORS.get(p.color)
|
c = COLORS.get(p.color)
|
||||||
|
|
||||||
set_color(an, c)
|
set_color(an, c)
|
||||||
|
|
||||||
# wait random amount of times
|
# wait random amount of times
|
||||||
|
|
Loading…
Reference in New Issue
Block a user