DeltaE.h 602 B

123456789101112131415161718192021
  1. /*
  2. * Copyright (c) 2023, Nico Weber <thakis@chromium.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibGfx/CIELAB.h>
  8. namespace Gfx {
  9. // Returns a number between 0 and 100 that describes how far apart two colors are in human perception.
  10. // A return value < 1 means that the two colors are not noticeably different.
  11. // The larger the return value, the easier it is to tell the two colors apart.
  12. // Works better for colors that are somewhat "close".
  13. //
  14. // You can use ICC::sRGB()->to_lab() to convert sRGB colors to CIELAB.
  15. float DeltaE(CIELAB const&, CIELAB const&);
  16. }