Advertisement
Guest User

Untitled

a guest
Jul 29th, 2016
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. const char *colors[] = {
  4. "2b303b",
  5. "343d46",
  6. "4f5b66",
  7. "65737e",
  8. "a7adba",
  9. "c0c5ce",
  10. "dfe1e8",
  11. "eff1f5",
  12. "bf616a",
  13. "d08770",
  14. "ebcb8b",
  15. "a3be8c",
  16. "96b5b4",
  17. "8fa1b3",
  18. "b48ead",
  19. "ab7967"
  20. };
  21.  
  22. int main() {
  23. char r[3]; r[2] = 0;
  24. char g[3]; g[2] = 0;
  25. char b[3]; b[2] = 0;
  26. for (int i = 0; i < 16; i++) {
  27. int i_r, i_g, i_b;
  28. r[0] = colors[i][0], r[1] = colors[i][1];
  29. g[0] = colors[i][2], g[1] = colors[i][3];
  30. b[0] = colors[i][4], b[1] = colors[i][5];
  31. sscanf(r, "%x", &i_r);
  32. sscanf(g, "%x", &i_g);
  33. sscanf(b, "%x", &i_b);
  34. printf("%d: %d %d %d 255\n", i, i_r, i_g, i_b);
  35. }
  36.  
  37. return 0;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement