From 350f9b616f2ebdd46482eb42958668b628dbd88b Mon Sep 17 00:00:00 2001 From: vadim Date: Tue, 30 May 2023 14:36:54 +0200 Subject: [PATCH] chore: refine WDS color `bdAccent` (#23872) ## Description tl;dr Smoother fallbacks when we're failing APCA contrast check as a border for the seed (more chroma, closer to the neutral lightness) Fixes #22630 ## Media New on the left, current on the right https://github.com/appsmithorg/appsmith/assets/80973/b13122c8-9159-4337-ae77-4dfa2df2151d ## Type of change - Bug fix (non-breaking change which fixes an issue) - New feature (non-breaking change which adds functionality) - Chore (housekeeping or task changes that don't impact user perception) ## How Has This Been Tested? - Manual ### Test Plan Initial POC refinement, no testing necessary ## Checklist: ### Dev activity - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag ### QA activity: - [ ] Test plan has been approved by relevant developers - [ ] Test plan has been peer reviewed by QA - [ ] Cypress test cases have been added and approved by either SDET or manual QA - [ ] Organized project review call with relevant stakeholders after Round 1/2 of QA - [ ] Added Test Plan Approved label after reveiwing all Cypress test --- .../theming/src/utils/TokensAccessor/DarkModeTheme.ts | 6 +++--- .../theming/src/utils/TokensAccessor/LightModeTheme.ts | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/client/packages/design-system/theming/src/utils/TokensAccessor/DarkModeTheme.ts b/app/client/packages/design-system/theming/src/utils/TokensAccessor/DarkModeTheme.ts index 5139826d34..bf0fe27a04 100644 --- a/app/client/packages/design-system/theming/src/utils/TokensAccessor/DarkModeTheme.ts +++ b/app/client/packages/design-system/theming/src/utils/TokensAccessor/DarkModeTheme.ts @@ -186,13 +186,13 @@ export class DarkModeTheme implements ColorModeTheme { if (this.bg.contrastAPCA(this.seedColor) >= -25) { if (this.seedIsAchromatic) { - color.oklch.l = 0.985; + color.oklch.l = 0.82; color.oklch.c = 0; return color; } - color.oklch.l = 0.985; - color.oklch.c = 0.016; + color.oklch.l = 0.75; + color.oklch.c = 0.15; return color; } diff --git a/app/client/packages/design-system/theming/src/utils/TokensAccessor/LightModeTheme.ts b/app/client/packages/design-system/theming/src/utils/TokensAccessor/LightModeTheme.ts index 902e80dad8..2dd57fb363 100644 --- a/app/client/packages/design-system/theming/src/utils/TokensAccessor/LightModeTheme.ts +++ b/app/client/packages/design-system/theming/src/utils/TokensAccessor/LightModeTheme.ts @@ -287,13 +287,13 @@ export class LightModeTheme implements ColorModeTheme { if (this.bg.contrastAPCA(this.seedColor) <= 25) { if (this.seedIsAchromatic) { - color.oklch.l = 0.15; + color.oklch.l = 0.3; color.oklch.c = 0; return color; } - color.oklch.l = 0.15; - color.oklch.c = 0.064; + color.oklch.l = 0.55; + color.oklch.c = 0.25; return color; }