-
Notifications
You must be signed in to change notification settings - Fork 2.1k
sys: added color module #1315
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
sys: added color module #1315
Conversation
Do you think you might be able to do this without floating point operations? |
Yes, it is possible, but its going together with a loss in accuracy. And especially for smooth transition of colors this can be visible to the human eye - so thats why I preferred floats here. |
/** | ||
* @brief Convert RGB color to HSV color | ||
* | ||
* @param rgb Input color encoded in RGB space |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[in] and [out] missing
fixed doxygen. |
ACK @haukepetersen please squash and merge at will |
ACK |
Squashed and go. |
19693: sys/color: extend unittest and fix module r=kfessel a=kfessel ### Contribution description this extends the unittest for sys_color testing more colors ### Testing procedure ``` RIOT_tree/tests/unittests$ make tests-color test ``` will fail since our `rgb2hsv` implementation is wrong (or is using an other colorspace than hsv2rgb (without documenting)) the new `hsv2rgb` test will succeed ### Issues/PRs references #19614 was the reason i had a look at this #1315 added the rgb2hsv and hsv2rgb function #9940 added the test for black special case https://www.vagrearg.org/content/hsvrgb << some optimization for that function (avoiding float) Co-authored-by: Karl Fessel <karl.fessel@ovgu.de>
19378: sys: add common imath module mv isin() form test/driver_dac_dds r=kfessel a=benpicco 19693: sys/color: extend unittest and fix module r=kfessel a=kfessel ### Contribution description this extends the unittest for sys_color testing more colors ### Testing procedure ``` RIOT_tree/tests/unittests$ make tests-color test ``` will fail since our `rgb2hsv` implementation is wrong (or is using an other colorspace than hsv2rgb (without documenting)) the new `hsv2rgb` test will succeed ### Issues/PRs references #19614 was the reason i had a look at this #1315 added the rgb2hsv and hsv2rgb function #9940 added the test for black special case https://www.vagrearg.org/content/hsvrgb << some optimization for that function (avoiding float) Co-authored-by: Benjamin Valentin <benpicco@beuth-hochschule.de> Co-authored-by: Karl Fessel <karl.fessel@ovgu.de>
19378: sys: add common imath module mv isin() form test/driver_dac_dds r=maribu a=benpicco 19693: sys/color: extend unittest and fix module r=kfessel a=kfessel ### Contribution description this extends the unittest for sys_color testing more colors ### Testing procedure ``` RIOT_tree/tests/unittests$ make tests-color test ``` will fail since our `rgb2hsv` implementation is wrong (or is using an other colorspace than hsv2rgb (without documenting)) the new `hsv2rgb` test will succeed ### Issues/PRs references #19614 was the reason i had a look at this #1315 added the rgb2hsv and hsv2rgb function #9940 added the test for black special case https://www.vagrearg.org/content/hsvrgb << some optimization for that function (avoiding float) Co-authored-by: Benjamin Valentin <benpicco@beuth-hochschule.de> Co-authored-by: Karl Fessel <karl.fessel@ovgu.de>
19693: sys/color: extend unittest and fix module r=kfessel a=kfessel ### Contribution description this extends the unittest for sys_color testing more colors ### Testing procedure ``` RIOT_tree/tests/unittests$ make tests-color test ``` will fail since our `rgb2hsv` implementation is wrong (or is using an other colorspace than hsv2rgb (without documenting)) the new `hsv2rgb` test will succeed ### Issues/PRs references #19614 was the reason i had a look at this #1315 added the rgb2hsv and hsv2rgb function #9940 added the test for black special case https://www.vagrearg.org/content/hsvrgb << some optimization for that function (avoiding float) Co-authored-by: Karl Fessel <karl.fessel@ovgu.de>
19693: sys/color: extend unittest and fix module r=maribu a=kfessel ### Contribution description this extends the unittest for sys_color testing more colors ### Testing procedure ``` RIOT_tree/tests/unittests$ make tests-color test ``` will fail since our `rgb2hsv` implementation is wrong (or is using an other colorspace than hsv2rgb (without documenting)) the new `hsv2rgb` test will succeed ### Issues/PRs references #19614 was the reason i had a look at this #1315 added the rgb2hsv and hsv2rgb function #9940 added the test for black special case https://www.vagrearg.org/content/hsvrgb << some optimization for that function (avoiding float) Co-authored-by: Karl Fessel <karl.fessel@ovgu.de>
Added a small module for handling RGB and HSV colors. This module is useful in conjunction with RGB-LEDs and similar applications.