chore: WDS color cleanup (#25848)

Closes #25035
This commit is contained in:
vadim 2023-08-02 15:03:42 +02:00 committed by GitHub
parent 92a54110ed
commit 306b1c44ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 944 additions and 946 deletions

View File

@ -11,6 +11,18 @@ export class ColorsAccessor {
return this; return this;
} }
get lightness() {
return this.color.oklch.l;
}
get chroma() {
return this.color.oklch.c;
}
get hue() {
return this.color.oklch.h;
}
/* Lightness */ /* Lightness */
get isVeryDark() { get isVeryDark() {
return this.color.oklch.l < 0.3; return this.color.oklch.l < 0.3;
@ -25,19 +37,11 @@ export class ColorsAccessor {
return this.color.oklch.c < 0.04; return this.color.oklch.c < 0.04;
} }
get isColorful() {
return this.color.oklch.c > 0.136;
}
/* Hue */ /* Hue */
get isCold() { get isCold() {
return this.color.oklch.h >= 120 && this.color.oklch.h <= 300; return this.color.oklch.h >= 120 && this.color.oklch.h <= 300;
} }
get isBlue() {
return this.color.oklch.h >= 230 && this.color.oklch.h <= 270;
}
get isGreen() { get isGreen() {
return this.color.oklch.h >= 116 && this.color.oklch.h <= 165; return this.color.oklch.h >= 116 && this.color.oklch.h <= 165;
} }
@ -49,16 +53,4 @@ export class ColorsAccessor {
get isRed() { get isRed() {
return this.color.oklch.h >= 5 && this.color.oklch.h <= 49; return this.color.oklch.h >= 5 && this.color.oklch.h <= 49;
} }
get lightness() {
return this.color.oklch.l;
}
get chroma() {
return this.color.oklch.c;
}
get hue() {
return this.color.oklch.h;
}
} }

View File

@ -11,6 +11,12 @@ export interface ColorModeTheme {
bgAccentActive: string; bgAccentActive: string;
bgAccentSubtleHover: string; bgAccentSubtleHover: string;
bgAccentSubtleActive: string; bgAccentSubtleActive: string;
bgAssistive: string;
bgNeutral: string;
bgNeutralHover: string;
bgNeutralActive: string;
bgNeutralSubtleHover: string;
bgNeutralSubtleActive: string;
bgPositive: string; bgPositive: string;
bgPositiveHover: string; bgPositiveHover: string;
bgPositiveActive: string; bgPositiveActive: string;
@ -26,34 +32,36 @@ export interface ColorModeTheme {
bgWarningActive: string; bgWarningActive: string;
bgWarningSubtleHover: string; bgWarningSubtleHover: string;
bgWarningSubtleActive: string; bgWarningSubtleActive: string;
bgNeutral: string;
bgNeutralHover: string;
bgNeutralActive: string;
bgNeutralSubtleHover: string;
bgNeutralSubtleActive: string;
// fg // fg
fg: string; fg: string;
fgAccent: string; fgAccent: string;
fgNegative: string;
fgNeutral: string; fgNeutral: string;
fgPositive: string; fgPositive: string;
fgNegative: string;
fgWarning: string; fgWarning: string;
// fg on bg*
fgOnAccent: string; fgOnAccent: string;
fgOnAssistive: string;
fgOnNeutral: string; fgOnNeutral: string;
fgOnPositive: string; fgOnPositive: string;
fgOnWarning: string;
fgOnNegative: string; fgOnNegative: string;
fgOnAssistive: string; fgOnWarning: string;
// bd // bd
bdAccent: string; bdAccent: string;
bdFocus: string; bdFocus: string;
bdNegative: string;
bdNegativeHover: string;
bdNeutral: string; bdNeutral: string;
bdNeutralHover: string; bdNeutralHover: string;
bdPositive: string; bdPositive: string;
bdPositiveHover: string; bdPositiveHover: string;
bdNegative: string;
bdNegativeHover: string;
bdWarning: string; bdWarning: string;
bdWarningHover: string; bdWarningHover: string;
// bd on bg*
bdOnAccent: string;
bdOnNeutral: string;
bdOnPositive: string;
bdOnNegative: string;
bdOnWarning: string;
}; };
} }