| 128 | } |
| 129 | |
| 130 | static void init_palette(void) { |
| 131 | int nn, mm = 0; |
| 132 | /* fun with colors */ |
| 133 | for (nn = 0; nn < PALETTE_SIZE / 4; nn++) { |
| 134 | int jj = (nn - mm) * 4 * 255 / PALETTE_SIZE; |
| 135 | palette[nn] = make565(255, jj, 255 - jj); |
| 136 | } |
| 137 | |
| 138 | for (mm = nn; nn < PALETTE_SIZE / 2; nn++) { |
| 139 | int jj = (nn - mm) * 4 * 255 / PALETTE_SIZE; |
| 140 | palette[nn] = make565(255 - jj, 255, jj); |
| 141 | } |
| 142 | |
| 143 | for (mm = nn; nn < PALETTE_SIZE * 3 / 4; nn++) { |
| 144 | int jj = (nn - mm) * 4 * 255 / PALETTE_SIZE; |
| 145 | palette[nn] = make565(0, 255 - jj, 255); |
| 146 | } |
| 147 | |
| 148 | for (mm = nn; nn < PALETTE_SIZE; nn++) { |
| 149 | int jj = (nn - mm) * 4 * 255 / PALETTE_SIZE; |
| 150 | palette[nn] = make565(jj, 0, 255); |
| 151 | } |
| 152 | } |
| 153 | |
| 154 | static __inline__ uint16_t palette_from_fixed(Fixed x) { |
| 155 | if (x < 0) x = -x; |
no test coverage detected