Rev 2302 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2302 | Rev 3022 | ||
---|---|---|---|
1 | #include <stdio.h> |
1 | #include <stdio.h> |
2 | 2 | ||
3 | #define RED(i) ((i >> 5) & ((1 << 3) - 1)) |
3 | #define RED(i) ((i >> 5) & ((1 << 3) - 1)) |
4 | #define GREEN(i) ((i >> 3) & ((1 << 2) - 1)) |
4 | #define GREEN(i) ((i >> 3) & ((1 << 2) - 1)) |
5 | #define BLUE(i) (i & ((1 << 3) - 1)) |
5 | #define BLUE(i) (i & ((1 << 3) - 1)) |
6 | 6 | ||
7 | int main(int argc, char *argv[]) { |
7 | int main(int argc, char *argv[]) { |
8 | unsigned int i; |
8 | unsigned int i; |
9 | 9 | ||
10 | for (i = 0; i < 256; i++) |
10 | for (i = 0; i < 256; i++) |
11 | printf("\t.byte 0x%02x, 0x%02x, 0x%02x, 0x00\n", BLUE(i) * 9, GREEN(i) * 21, RED(i) * 9); |
11 | printf("\t.byte 0x%02x, 0x%02x, 0x%02x, 0x00\n", BLUE(i) * 9, GREEN(i) * 21, RED(i) * 9); |
12 | 12 | ||
13 | return 0; |
13 | return 0; |
14 | } |
14 | } |
15 | 15 |