Subversion Repositories HelenOS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. #include <stdio.h>
  2.  
  3. #define RED(i) ((i >> 5) & ((1 << 3) - 1))
  4. #define GREEN(i) ((i >> 3) & ((1 << 2) - 1))
  5. #define BLUE(i) (i & ((1 << 3) - 1))
  6.  
  7. int main(int argc, char *argv[]) {
  8.     unsigned int i;
  9.    
  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);
  12.    
  13.     return 0;
  14. }
  15.