SFML community forums

Help => Graphics => Topic started by: Hedgeberry on July 12, 2022, 12:55:55 pm

Title: Shift HSV-color
Post by: Hedgeberry on July 12, 2022, 12:55:55 pm
Is there any built-in HSV-color shift functionality?
Let's say I need to shift the color shade by 32, is there any simple way to do it or will I have to write my own RGB to HSV conversions, shift and convert back there?
Title: Re: Shift HSV-color
Post by: eXpl0it3r on July 12, 2022, 01:16:52 pm
SFML doesn't offer any color space conversion, everything is in RGBA.

So yes, you'd have to convert it. Entering "HSV SFML" in a web search, I ended up with: https://gist.github.com/marukrap/7c361f2c367eaf40537a8715e3fd952a
Title: Re: Shift HSV-color
Post by: Hapax on July 16, 2022, 11:42:52 am
Very slightly gutted my stuff didn't appear in your search... :P

https://github.com/Hapaxia/Plinth/blob/master/Plinth/Color.hpp
https://github.com/Hapaxia/Plinth/blob/master/Plinth/Color.cpp

 ;D