Open lulu-yunze opened 2 months ago
The range of mod(a, b) for all (a, b) in the domain is [0, 5], keep adding 6 until the result falls in [0, 5].
I am using std::fmod and when (G-B)/C is negative, mod 6 returns a negative number. For example, if (G-B)/C = -0.2, then -0.2 % 6 = -0.2. What do I do in this situation? Should it return 0 instead of -0.2?
Hello,
For rgb to hsv conversion I am using the formula from wikipedia:
How do we deal with the case when (G-B)/C mod 6 is negative if R is the largest value?
Thank you very much.