Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EFX precision when controlling RGB channels #593

Open
mcallegari opened this issue Oct 6, 2015 · 1 comment
Open

EFX precision when controlling RGB channels #593

mcallegari opened this issue Oct 6, 2015 · 1 comment

Comments

@mcallegari
Copy link
Owner

When an EFX controls RGB channels, it looks up for colors in a 256x256 Gradient table created here
https://github.com/mcallegari/qlcplus/blob/master/engine/src/gradient.cpp#L65

Vertically the pixmap has enough precision, but when a EFX moves horizontally, the color transitions are snappy.
Unfortunately ther's not much we can do, as EFX values themselves range from 0 to 255.
We could though lookup for the color a step before, when we're still in float and have more precision.
However this would mean to increase the Gradient size and I guess every hardcoded size will not work

Best thing would be to have a color lookup calculated mathematically, instead of a static bitmap lookup.

@janosvitok
Copy link
Contributor

In QT, QColor::fromHslF() http://doc.qt.io/qt-4.8/qcolor.html#fromHslF may be used. For JS, here are the equations: https://en.wikipedia.org/wiki/HSL_and_HSV#From_HSL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants