porsager / busylight

node library for busylight
49 stars 17 forks source link

light dimmed? #27

Closed lauer closed 2 years ago

lauer commented 3 years ago

When using this package in my electronjs project, the light is very dimm.

When using this python script, the light is very bright. https://github.com/JnyJny/busylight

What can be the reason for this?

I have enabled debug and this is the writing buffer

"Writing buffer: 0,16,0,0,6,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,6,147"

I am using e.g. bl.light('green')

porsager commented 3 years ago

Are you perhaps using 0 - 100 values instead of 0 - 255?

lauer commented 3 years ago

It doesn't really matter if I sent rgb(0,255,0) greenor #0F0 - the color is still not as bright

porsager commented 3 years ago

Try run with the option degamma: false

lauer commented 3 years ago

Also tried

lauer commented 3 years ago

Ahh, sorry. It is only 'green' which causes low brightness.

rgb(0,255,0) and #0F0 sent the full brightness.

See the diferrence here:

[ 'rgb(0,255,0)', 'light' ]
Writing buffer: 0,16,0,0,31,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,4,146
[ '#0F0', 'light' ]
Writing buffer: 0,16,0,0,31,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,4,171
[ 'green', 'light' ]
Writing buffer: 0,16,0,0,6,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,4,171
lauer commented 2 years ago

so the problem is actually that it newer check for degamma is true or false. It always apply the function.

In my case, light is way better when degamma is not applied.

lauer commented 2 years ago

See this commit https://github.com/lauer/busylight/commit/1eef7a70f492774b29ea766ce2bc9a8489662c81

Since you didn't have time to apply my other pull request, I haven't created one for this, but will just use my own master in my app.

porsager commented 2 years ago

Hi @lauer .. sorry, I've been extremely busy at work, so yeah, good thing you can always fork, but sorry about the radio silence.

If you make a pull request with a fix for this as well, I'll get both merged and do an npm release today.

porsager commented 2 years ago

I'd also be happy to add you as a maintainer for the repo if you'd like?

lauer commented 2 years ago

Same here, but one of my projects is to get this busylight to work better :)

I need to create separate branches for each commit, so it will take some time. I might look at it this week.

porsager commented 2 years ago

Hi @lauer .. Once again.. sorry I haven't been able to prioritise this.. Merged your PR and if you'll PR your degamma things I'll get them merged and do a new release for npm as well.

porsager commented 2 years ago

Thanks a lot @lauer ! I've released a new version with the updates on npm now.