You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This could be done pretty easily by copying lib/core/color/hsv.rb. The algorithm is slightly different for converting to/from RGB, but it shouldn't be too bad. There are other examples on the net of algorithms for doing that.
In each example, the underlying algorithm is essentially the same. Hue calculations shouldn't change at all, and brightness/saturation/value calculations are pretty basic. In most cases, it looks like you take the maximum of any of the RGB values and set that as the brightness value. And your saturation is the distance of your highest/lowest R, G, or B value away from the average of all three... I think. Again, I'd just convert an existing, working algorithm into Ruby. :-)
Not sure about the syntax. This OF forum post could serve as a jumping off point.
The text was updated successfully, but these errors were encountered: