lab.d.ts 805 B

1234567891011121314151617181920212223
  1. import { LabaColor, AnyColor } from "../types";
  2. import { Plugin } from "../extend";
  3. declare module "../colord" {
  4. interface Colord {
  5. /**
  6. * Converts a color to CIELAB color space and returns an object.
  7. * The object always includes `alpha` value [0, 1].
  8. */
  9. toLab(): LabaColor;
  10. /**
  11. * Calculates the perceived color difference for two colors according to
  12. * [Delta E2000](https://en.wikipedia.org/wiki/Color_difference#CIEDE2000).
  13. * Returns a value in [0, 1] range.
  14. */
  15. delta(color?: AnyColor | Colord): number;
  16. }
  17. }
  18. /**
  19. * A plugin adding support for CIELAB color space.
  20. * https://en.wikipedia.org/wiki/CIELAB_color_space
  21. */
  22. declare const labPlugin: Plugin;
  23. export default labPlugin;