]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/lib/color.qh
Uncrustify lib/*
[xonotic/xonotic-data.pk3dir.git] / qcsrc / lib / color.qh
1 #ifndef COLOR_H
2 #define COLOR_H
3
4 #define colormapPaletteColor(c, isPants) colormapPaletteColor_(c, isPants, time)
5 vector colormapPaletteColor_(int c, bool isPants, float t)
6 {
7         switch (c)
8         {
9                 case  0: return '1.000000 1.000000 1.000000';
10                 case  1: return '1.000000 0.333333 0.000000';
11                 case  2: return '0.000000 1.000000 0.501961';
12                 case  3: return '0.000000 1.000000 0.000000';
13                 case  4: return '1.000000 0.000000 0.000000';
14                 case  5: return '0.000000 0.666667 1.000000';
15                 case  6: return '0.000000 1.000000 1.000000';
16                 case  7: return '0.501961 1.000000 0.000000';
17                 case  8: return '0.501961 0.000000 1.000000';
18                 case  9: return '1.000000 0.000000 1.000000';
19                 case 10: return '1.000000 0.000000 0.501961';
20                 case 11: return '0.000000 0.000000 1.000000';
21                 case 12: return '1.000000 1.000000 0.000000';
22                 case 13: return '0.000000 0.333333 1.000000';
23                 case 14: return '1.000000 0.666667 0.000000';
24                 case 15:
25                         if (isPants)
26                                 return '1 0 0' * (0.502 + 0.498 * sin(t / 2.7182818285 + 0.0000000000))
27                                        + '0 1 0' * (0.502 + 0.498 * sin(t / 2.7182818285 + 2.0943951024))
28                                        + '0 0 1' * (0.502 + 0.498 * sin(t / 2.7182818285 + 4.1887902048));
29                         else
30                                 return '1 0 0' * (0.502 + 0.498 * sin(t / 3.1415926536 + 5.2359877560))
31                                        + '0 1 0' * (0.502 + 0.498 * sin(t / 3.1415926536 + 3.1415926536))
32                                        + '0 0 1' * (0.502 + 0.498 * sin(t / 3.1415926536 + 1.0471975512));
33                 default: return '0.000 0.000 0.000';
34         }
35 }
36
37 #endif