You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
1.1KB

  1. #pragma once
  2. #include "common.hpp"
  3. #include "string.hpp"
  4. #include <nanovg.h>
  5. namespace rack {
  6. namespace color {
  7. static const NVGcolor BLACK_TRANSPARENT = nvgRGBA(0x00, 0x00, 0x00, 0x00);
  8. static const NVGcolor BLACK = nvgRGB(0x00, 0x00, 0x00);
  9. static const NVGcolor WHITE_TRANSPARENT = nvgRGBA(0xff, 0xff, 0xff, 0x00);
  10. static const NVGcolor WHITE = nvgRGB(0xff, 0xff, 0xff);
  11. static const NVGcolor RED = nvgRGB(0xff, 0x00, 0x00);
  12. static const NVGcolor GREEN = nvgRGB(0x00, 0xff, 0x00);
  13. static const NVGcolor BLUE = nvgRGB(0x00, 0x00, 0xff);
  14. static const NVGcolor CYAN = nvgRGB(0x00, 0xff, 0xff);
  15. static const NVGcolor MAGENTA = nvgRGB(0xff, 0x00, 0xff);
  16. static const NVGcolor YELLOW = nvgRGB(0xff, 0xff, 0x00);
  17. NVGcolor clamp(NVGcolor a);
  18. NVGcolor minus(NVGcolor a, NVGcolor b);
  19. NVGcolor plus(NVGcolor a, NVGcolor b);
  20. NVGcolor mult(NVGcolor a, NVGcolor b);
  21. NVGcolor mult(NVGcolor a, float x);
  22. /** Screen blending with alpha compositing */
  23. NVGcolor screen(NVGcolor a, NVGcolor b);
  24. NVGcolor alpha(NVGcolor a, float alpha);
  25. NVGcolor fromHexString(std::string s);
  26. std::string toHexString(NVGcolor c);
  27. } // namespace color
  28. } // namespace rack