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

Fix(color): HSV to RGB when saturation is 0 #104

Merged
merged 3 commits into from
Aug 10, 2023
Merged

Fix(color): HSV to RGB when saturation is 0 #104

merged 3 commits into from
Aug 10, 2023

Conversation

finger563
Copy link
Contributor

Description

  • Fixed rgb to hsv conversion in scenario where hsv saturation was 0, in which we were erroneously setting the saturation to -1, preventing conversion back to rgb properly
  • Updated example to test white and grey hsv to rgb conversions
  • Updated example to test rgb to hsv conversions
  • Updated example to print out text in color using the rgb codes

Motivation and Context

There was an error when converting RGB(1,1,1) to HSV which would give a hue value of -1, which would then mess up the conversion back to RGB if you did so. This fixes that and extends the test a little bit.

How has this been tested?

Building and running the example.

Screenshots (if appropriate, e.g. schematic, board, console logs, lab pictures):

CleanShot 2023-08-10 at 10 16 22

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update
  • Hardware (schematic, board, system design) change
  • Software change

Checklist:

  • My change requires a change to the documentation.
  • I have added / updated the documentation related to this change via either README or WIKI

Software

  • I have added tests to cover my changes.
  • I have updated the .github/workflows/build.yml file to add my new test to the automated cloud build github action.
  • All new and existing tests passed.
  • My code follows the code style of this project.

* Fixed rgb to hsv conversion in scenario where hsv saturation was 0, in which we were erroneously setting the saturation to -1, preventing conversion back to rgb properly
* Updated example to test white and grey hsv to rgb conversions
* Updated example to test rgb to hsv conversions
* Updated example to print out text in color using the rgb codes
@finger563 finger563 added bug Something isn't working color labels Aug 10, 2023
@finger563 finger563 merged commit d36e634 into main Aug 10, 2023
39 checks passed
@finger563 finger563 deleted the bugfix/color branch August 10, 2023 15:21
@finger563 finger563 changed the title Bugfix/color Fix(color): HSV to RGB when saturation is 0 Aug 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working color
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant