9630920f5c16452b040be7a9b00b78ec7c1e2e30d10eb9f281555dbd61b6362b24281f495d54d0915901513aeb8533dac39372a57825b3d97bb90e2b43444a 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /**
  2. * convert all properties in an interface to a number
  3. */
  4. export type Numberify<T> = {
  5. [P in keyof T]: number;
  6. };
  7. /**
  8. * A representation of additive color mixing.
  9. * Projection of primary color lights on a white screen shows secondary
  10. * colors where two overlap; the combination of all three of red, green,
  11. * and blue in equal intensities makes white.
  12. */
  13. export interface RGB {
  14. r: number | string;
  15. g: number | string;
  16. b: number | string;
  17. }
  18. export interface RGBA extends RGB {
  19. a: number;
  20. }
  21. /**
  22. * The HSL model describes colors in terms of hue, saturation,
  23. * and lightness (also called luminance).
  24. * @link https://en.wikibooks.org/wiki/Color_Models:_RGB,_HSV,_HSL#HSL
  25. */
  26. export interface HSL {
  27. h: number | string;
  28. s: number | string;
  29. l: number | string;
  30. }
  31. export interface HSLA extends HSL {
  32. a: number;
  33. }
  34. /**
  35. * The HSV, or HSB, model describes colors in terms of
  36. * hue, saturation, and value (brightness).
  37. * @link https://en.wikibooks.org/wiki/Color_Models:_RGB,_HSV,_HSL#HSV
  38. */
  39. export interface HSV {
  40. h: number | string;
  41. s: number | string;
  42. v: number | string;
  43. }
  44. export interface HSVA extends HSV {
  45. a: number;
  46. }