From a55012c75802db75159748c930beb7f852af8133 Mon Sep 17 00:00:00 2001 From: Matt Wozniski Date: Fri, 6 Feb 2009 02:26:17 -0500 Subject: [PATCH] Fix a silly mistake. This bug would stop CSApprox from ever choosing #080808 (or the lowest color on the greyscale ramp of another palette) as the closest match for any color. --- plugin/CSApprox.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/CSApprox.vim b/plugin/CSApprox.vim index b1c5365..c58aa3c 100644 --- a/plugin/CSApprox.vim +++ b/plugin/CSApprox.vim @@ -118,7 +118,7 @@ function! s:ApproximatePerComponent(r,g,b) let b = s:NearestElemInList(a:b, greys_colors) let len = len(colors) - if (r == g && g == b && index(greys, r) > 0) + if (r == g && g == b && index(greys, r) != -1) let rv = 16 + len * len * len + index(greys, r) else let r = s:NearestElemInList(a:r, colors)