]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/lib/color.qh
Merge branch 'master' into terencehill/menu_gametype_tooltips_2
[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         case  0: return '1.000000 1.000000 1.000000';
9         case  1: return '1.000000 0.333333 0.000000';
10         case  2: return '0.000000 1.000000 0.501961';
11         case  3: return '0.000000 1.000000 0.000000';
12         case  4: return '1.000000 0.000000 0.000000';
13         case  5: return '0.000000 0.666667 1.000000';
14         case  6: return '0.000000 1.000000 1.000000';
15         case  7: return '0.501961 1.000000 0.000000';
16         case  8: return '0.501961 0.000000 1.000000';
17         case  9: return '1.000000 0.000000 1.000000';
18         case 10: return '1.000000 0.000000 0.501961';
19         case 11: return '0.000000 0.000000 1.000000';
20         case 12: return '1.000000 1.000000 0.000000';
21         case 13: return '0.000000 0.333333 1.000000';
22         case 14: return '1.000000 0.666667 0.000000';
23         case 15:
24             if (isPants)
25                 return
26                       '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
31                       '1 0 0' * (0.502 + 0.498 * sin(t / 3.1415926536 + 5.2359877560))
32                     + '0 1 0' * (0.502 + 0.498 * sin(t / 3.1415926536 + 3.1415926536))
33                     + '0 0 1' * (0.502 + 0.498 * sin(t / 3.1415926536 + 1.0471975512));
34         default: return '0.000 0.000 0.000';
35     }
36 }
37
38 #endif