From 5eb792c49d65472a512a909f223ad209ce0be828 Mon Sep 17 00:00:00 2001 From: stephenLYZ <750188453@qq.com> Date: Thu, 31 Mar 2022 08:41:45 +0800 Subject: [PATCH] add some comment --- superset-frontend/packages/superset-ui-core/src/color/utils.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/superset-frontend/packages/superset-ui-core/src/color/utils.ts b/superset-frontend/packages/superset-ui-core/src/color/utils.ts index 8ea80d4bec89a..0ce64d049012c 100644 --- a/superset-frontend/packages/superset-ui-core/src/color/utils.ts +++ b/superset-frontend/packages/superset-ui-core/src/color/utils.ts @@ -55,6 +55,8 @@ export function getContrastingColor(color: string, thresholds = 186) { export function getAnalogousColors(colors: string[], results: number) { const generatedColors: string[] = []; + // This is to solve the problem that the first three values generated by tinycolor.analogous + // may have the same or very close colors. const ext = 3; const analogousColors = colors.map(color => { const result = tinycolor(color).analogous(results + ext);