color.hpp 702 B

123456789101112131415161718192021222324252627282930313233343536
  1. #ifndef COLOR_HPP_INCLUDED
  2. #define COLOR_HPP_INCLUDED
  3. #include <stdint.h>
  4. #include <cairomm/context.h>
  5. namespace cx_light {
  6. class color {
  7. public:
  8. color();
  9. ~color();
  10. static color from_hex(long);
  11. static color from_rgb(uint8_t, uint8_t, uint8_t);
  12. static color from_white(long);
  13. uint8_t get_red();
  14. uint8_t get_green();
  15. uint8_t get_blue();
  16. double get_normalized_red();
  17. double get_normalized_green();
  18. double get_normalized_blue();
  19. void set_source(const Cairo::RefPtr<Cairo::Context> &);
  20. private:
  21. uint8_t red;
  22. uint8_t green;
  23. uint8_t blue;
  24. };
  25. }
  26. #endif