cll
January 19, 2017, 3:04pm
1
The standard colors are quite… Blinding. I’d like to lower the brightness, which is possible in the command line tool. But I can’t find it anywhere in your Python API; Is there a plan to implement it? Or any workarounds? I’d like to half the brightness of all colors specifically.
Thanks
1 Like
p0ke
January 19, 2017, 9:16pm
2
Hello and welcome to the forums.
Please take a look at this thread to find a Solution for brightness control:
Thanks @p0ke , that worked great!
def goDarkBlue():
for bstick in blinkstick.find_all():
Brightness = 5
bstick.set_inverse(True)
r,g,b = bstick._hex_to_rgb("#3F89FF")
r = (Brightness / 100.0 * r)
g = (Brightness / 100.0 * g)
b = (Brightness / 100.0 * b)
bstick.set_color(red=r, green=g, blue=b)
return redirect("/")
Is how I adapted your sample script.
Thanks again.
I hope it helps
1 Like
cll
January 23, 2017, 7:47am
3
I made it work with that. Thanks!
victor
March 20, 2017, 9:50pm
4
Might be a little late but I personally like to work with HSL and HSV over RGB which gives me control of the brightness.
The colorsys package has some useful functions to convert RGB values.