From 3b785133ea171a9992e402bfb4143f1e029b77c2 Mon Sep 17 00:00:00 2001 From: David Capello Date: Sun, 9 May 2021 17:41:11 -0300 Subject: [PATCH] Add comment about possible future configuration for findBestfit2() --- src/doc/palette.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/doc/palette.cpp b/src/doc/palette.cpp index 114106a6d..f986f62a6 100644 --- a/src/doc/palette.cpp +++ b/src/doc/palette.cpp @@ -1,5 +1,5 @@ // Aseprite Document Library -// Copyright (c) 2020 Igara Studio S.A. +// Copyright (c) 2020-2021 Igara Studio S.A. // Copyright (c) 2001-2017 David Capello // // This file is released under the terms of the MIT license. @@ -366,6 +366,9 @@ int Palette::findBestfit2(int r, int g, int b) const int gDiff = g - rgba_getg(rgb); int bDiff = b - rgba_getb(rgb); + // TODO We should have two different ways to calculate the + // distance between colors, like "Perceptual" and "Linear", or a + // way to configure these coefficients. int diff = rDiff * rDiff * 900 + gDiff * gDiff * 3481 + bDiff * bDiff * 121; if (diff < lowest) { lowest = diff;