stephenLYZ commented on a change in pull request #19325: URL: https://github.com/apache/superset/pull/19325#discussion_r836548103
########## File path: superset-frontend/packages/superset-ui-core/src/color/utils.ts ########## @@ -51,3 +52,22 @@ export function getContrastingColor(color: string, thresholds = 186) { return r * 0.299 + g * 0.587 + b * 0.114 > thresholds ? '#000' : '#FFF'; } + +export function getAnalogousColors(colors: string[], results: number) { + const generatedColors: string[] = []; + const ext = 3; Review comment: Good catch! This is to solve the problem that the first three values generated by `tinycolor.analogous` may have the same or very close colors. You can see my local test: <img width="1427" alt="image" src="https://user-images.githubusercontent.com/11830681/160428321-5f9c5ab3-c653-42db-b2f0-2c749bec9975.png"> Let me add some comments here. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org For additional commands, e-mail: notifications-h...@superset.apache.org