Skip to content

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

Merged
merged 1 commit into from
Jun 22, 2014
Merged

Conversation

haukepetersen
Copy link
Contributor

Added a small module for handling RGB and HSV colors. This module is useful in conjunction with RGB-LEDs and similar applications.

@Kijewski
Copy link
Contributor

Do you think you might be able to do this without floating point operations?

@haukepetersen
Copy link
Contributor Author

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[in] and [out] missing

@haukepetersen
Copy link
Contributor Author

fixed doxygen.

@mehlis
Copy link
Contributor

mehlis commented Jun 15, 2014

ACK

@haukepetersen please squash and merge at will

@OlegHahm
Copy link
Member

ACK

@haukepetersen
Copy link
Contributor Author

Squashed and go.

haukepetersen added a commit that referenced this pull request Jun 22, 2014
@haukepetersen haukepetersen merged commit d9a7e67 into RIOT-OS:master Jun 22, 2014
@haukepetersen haukepetersen deleted the add_sys_color branch June 22, 2014 11:54
bors bot added a commit that referenced this pull request Jun 5, 2023
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>
bors bot added a commit that referenced this pull request Jun 5, 2023
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>
bors bot added a commit that referenced this pull request Jun 5, 2023
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>
bors bot added a commit that referenced this pull request Jun 5, 2023
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>
bors bot added a commit that referenced this pull request Jun 6, 2023
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: needs squashing Commits in this PR need to be squashed; If set, CI systems will mark this PR as unmergable Type: new feature The issue requests / The PR implemements a new feature for RIOT
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants