Я назначаю приложение для встреч.
У меня есть эта градиентная структура (созданная в Pixelmator), с помощью которой я хочу отметить время дня:
In the intended scheme, 8am would be solid green, 12 noon would be solid yellow, and 8pm would be solid blue.
I need an algorithm to take the times of day and turn them into those colors, but I can't figure it out, particularly from noon to evening.
These colors are composed using the HSB value system: all colors have S and B at 100%, and from left to right the hue values are 121 (green), 60 (yellow), and 229 (blue).
The progression from the green to yellow is (morning to noon) is straightforward, because it's just a linear scaling from 121 to 60, but from yellow to blue (noon to evening), is not; this is clear if you think about the fact that going from 60 to 229 in a linear fashion would first duplicate the green-to-yellow gradient, just in reverse order, and then would go to from green to blue. In other words, a strictly linear progression would make the gradient look more like this:
градиент от зеленого к желтому, от зеленого к синему
Может ли кто-нибудь указать мне в правильном направлении, чтобы понять, как создать алгоритм, который мне здесь нужен? Должен ли я использовать другую систему значений цвета, например RGB?
Заранее благодарим за любую помощь!