# Control brightness in Python API?

**URL:** <https://forums.blinkstick.com/t/control-brightness-in-python-api/669>\
**Category:** Support\
**Created:** [January 19, 2017, 3:04pm UTC](https://forums.blinkstick.com/t/control-brightness-in-python-api/669 "2017-01-19T15:04:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cll](https://forums.blinkstick.com/letter_avatar_proxy/v4/letter/c/6f9a4e/32.png) [@cll](https://forums.blinkstick.com/u/cll)\
**Post date:** [January 19, 2017, 3:04pm UTC](https://forums.blinkstick.com/t/control-brightness-in-python-api/669/1 "2017-01-19T15:04:13Z")

</div>

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 😄

---

<div class="post-metadata">

**Author:** ![p0ke](https://forums.blinkstick.com/user_avatar/forums.blinkstick.com/p0ke/32/14_2.png) [@p0ke](https://forums.blinkstick.com/u/p0ke)\
**Post date:** [January 19, 2017, 9:16pm UTC](https://forums.blinkstick.com/t/control-brightness-in-python-api/669/2 "2017-01-19T21:16:19Z")

</div>

Hello and welcome to the forums.

Please take a look at this thread to find a Solution for brightness control:

> [@Would is be possible to power LED strips using USB](https://forums.blinkstick.com/t/would-is-be-possible-to-power-led-strips-using-usb/648/6):
>
> 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

---

<div class="post-metadata">

**Author:** ![cll](https://forums.blinkstick.com/letter_avatar_proxy/v4/letter/c/6f9a4e/32.png) [@cll](https://forums.blinkstick.com/u/cll)\
**Post date:** [January 23, 2017, 7:47am UTC](https://forums.blinkstick.com/t/control-brightness-in-python-api/669/3 "2017-01-23T07:47:47Z")

</div>

I made it work with that. Thanks!

---

<div class="post-metadata">

**Author:** ![victor](https://forums.blinkstick.com/letter_avatar_proxy/v4/letter/v/3e96dc/32.png) [@victor](https://forums.blinkstick.com/u/victor)\
**Post date:** [March 20, 2017, 9:50pm UTC](https://forums.blinkstick.com/t/control-brightness-in-python-api/669/4 "2017-03-20T21:50:23Z")

</div>

Might be a little late but I personally like to work with [HSL and HSV](https://en.wikipedia.org/wiki/HSL_and_HSV) over RGB which gives me control of the brightness.

The [colorsys](https://docs.python.org/2/library/colorsys.html) package has some useful functions to convert RGB values.
