You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/03/28 15:16:43 UTC
[GitHub] [superset] stephenLYZ commented on a change in pull request #19325: feat(color): support analogous colors to prevent color conflict
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-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org