From 61c1cad92f009240d2a7bd549f36cee48b5fba3d Mon Sep 17 00:00:00 2001 From: David Schnur Date: Sat, 22 Dec 2012 09:59:26 -0500 Subject: [PATCH] Clarify comments describing color generation. --- jquery.flot.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/jquery.flot.js b/jquery.flot.js index 3c96a6c..6788f14 100644 --- a/jquery.flot.js +++ b/jquery.flot.js @@ -423,8 +423,8 @@ Licensed under the MIT license. var neededColors = series.length, maxIndex = 0, i; - // Subtract the number of series that already have fixed - // colors from the number we need to generate. + // Subtract the number of series that already have fixed colors or + // color indexes from the number that we still need to generate. for (i = 0; i < series.length; ++i) { var sc = series[i].color; @@ -436,14 +436,15 @@ Licensed under the MIT license. } } - // If any of the user colors are numeric indexes, then we - // need to generate at least as many as the highest index. + // If any of the series have fixed color indexes, then we need to + // generate at least as many colors as the highest index. if (maxIndex >= neededColors) { neededColors = maxIndex + 1; } - // Generate the needed colors, based on the option colors + // Generate all the colors, using first the option colors and then + // variations on those colors once they're exhausted. var c, colors = [], colorPool = options.colors, colorPoolSize = colorPool.length, variation = 0;