We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8844c94 commit 5f26ba2Copy full SHA for 5f26ba2
src/style/colors.ts
@@ -273,10 +273,10 @@ export class Colors {
273
return _.inRange(hue, 51, 184);
274
}
275
276
- isDark(colorValue: string | OpaqueColorValue) {
+ isDark(colorValue: string | OpaqueColorValue, darkThreshold = 0.55) {
277
const color = colorValue === null ? undefined : colorStringValue(colorValue);
278
const lum = tinycolor(color).getLuminance();
279
- return lum < 0.55;
+ return lum < darkThreshold;
280
281
isValidHex(string: string) {
282
return /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(string);
0 commit comments