#include "string.qh"
#define colormapPaletteColor(c, isPants) colormapPaletteColor_(c, isPants, time)
-[[eraseable]]
+ERASEABLE
vector colormapPaletteColor_(int c, bool isPants, float t)
{
switch (c)
case 14: return '1.000000 0.666667 0.000000';
case 15:
if (isPants)
- return '1 0 0' * (0.502 + 0.498 * sin(t / 2.7182818285 + 0.0000000000))
- + '0 1 0' * (0.502 + 0.498 * sin(t / 2.7182818285 + 2.0943951024))
- + '0 0 1' * (0.502 + 0.498 * sin(t / 2.7182818285 + 4.1887902048));
+ return '1 0 0' * (0.502 + 0.498 * sin(t / M_E + 0))
+ + '0 1 0' * (0.502 + 0.498 * sin(t / M_E + M_PI * 2 / 3))
+ + '0 0 1' * (0.502 + 0.498 * sin(t / M_E + M_PI * 4 / 3));
else
- return '1 0 0' * (0.502 + 0.498 * sin(t / 3.1415926536 + 5.2359877560))
- + '0 1 0' * (0.502 + 0.498 * sin(t / 3.1415926536 + 3.1415926536))
- + '0 0 1' * (0.502 + 0.498 * sin(t / 3.1415926536 + 1.0471975512));
+ return '1 0 0' * (0.502 + 0.498 * sin(t / M_PI + M_PI * 5 / 3))
+ + '0 1 0' * (0.502 + 0.498 * sin(t / M_PI + M_PI))
+ + '0 0 1' * (0.502 + 0.498 * sin(t / M_PI + M_PI * 1 / 3));
default: return '0.000 0.000 0.000';
}
}
-[[eraseable]]
+ERASEABLE
float rgb_mi_ma_to_hue(vector rgb, float mi, float ma)
{
if (mi == ma)
}
}
-[[eraseable]]
+ERASEABLE
vector hue_mi_ma_to_rgb(float hue, float mi, float ma)
{
vector rgb;
return rgb;
}
-[[eraseable]]
+ERASEABLE
vector rgb_to_hsv(vector rgb)
{
float mi, ma;
return hsv;
}
-[[eraseable]]
+ERASEABLE
vector hsv_to_rgb(vector hsv)
{
return hue_mi_ma_to_rgb(hsv.x, hsv.z * (1 - hsv.y), hsv.z);
}
-[[eraseable]]
+ERASEABLE
vector rgb_to_hsl(vector rgb)
{
float mi, ma;
return hsl;
}
-[[eraseable]]
+ERASEABLE
vector hsl_to_rgb(vector hsl)
{
float mi, ma, maminusmi;
return hue_mi_ma_to_rgb(hsl.x, mi, ma);
}
-[[eraseable]]
+ERASEABLE
string rgb_to_hexcolor(vector rgb)
{
return strcat(