Advertisement
Guest User

Examples of 16 bits colors in C++

a guest
Sep 23rd, 2016
437
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.42 KB | None | 0 0
  1. uint16_t color;
  2.  
  3. // white
  4. color = 0b1111111111111111; // binary representation
  5. color = 0xFFFF;             // hexadecimal representation
  6. color = 65535;              // decimal representation
  7.  
  8. // black
  9. color = 0b0000000000000000; // binary representation
  10. color = 0x0000;             // hexadecimal representation
  11. color = 0;                  // decimal representation
  12.  
  13. // yellow
  14. color = 0b1111111111100000; // binary representation
  15. color = 0xFFE0;             // hexadecimal representation
  16. color = 65504;              // decimal representation
  17.  
  18. // blue
  19. color = 0b0000000000011111; // binary representation
  20. color = 0x001F;             // hexadecimal representation
  21. color = 31;                 // decimal representation
  22.  
  23. // red
  24. color = 0b1111100000000000; // binary representation
  25. color = 0xF800;             // hexadecimal representation
  26. color = 63488;              // decimal representation
  27.  
  28. // green
  29. color = 0b0000011111100000; // binary representation
  30. color = 0x07E0;             // hexadecimal representation
  31. color = 2016;               // decimal representation
  32.  
  33. // cyan
  34. color = 0b0000011111111111; // binary representation
  35. color = 0x07FF;             // hexadecimal representation
  36. color = 2047;               // decimal representation
  37.  
  38. // magenta
  39. color = 0b1111100000011111; // binary representation
  40. color = 0xF81F;             // hexadecimal representation
  41. color = 63519;              // decimal representation
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement