@cloud-ru/ds-code-editor 1.0.3-preview-fe0a44cc.0 → 1.0.3-preview-848e7fc1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/CodeEditor/CodeEditor.js +1 -3
- package/dist/cjs/constants.d.ts +0 -1
- package/dist/cjs/constants.js +0 -1
- package/dist/cjs/utils.d.ts +1 -1
- package/dist/cjs/utils.js +4 -5
- package/dist/esm/components/CodeEditor/CodeEditor.js +2 -4
- package/dist/esm/constants.d.ts +0 -1
- package/dist/esm/constants.js +0 -1
- package/dist/esm/utils.d.ts +1 -1
- package/dist/esm/utils.js +3 -4
- package/dist/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/components/CodeEditor/CodeEditor.tsx +2 -4
- package/src/constants.ts +0 -1
- package/src/utils.ts +3 -4
package/src/utils.ts
CHANGED
|
@@ -57,10 +57,9 @@ export function rgb2hsl(htmlColor: string): [number, number, number] {
|
|
|
57
57
|
return [h, s, l];
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
//
|
|
61
|
-
//
|
|
62
|
-
|
|
63
|
-
export function isLightBackground(color: string) {
|
|
60
|
+
// Treats colors with low hue + medium lightness OR high hue + high lightness as
|
|
61
|
+
// 'light enough that text should be dark'. Hue thresholds use the 0–360 scale.
|
|
62
|
+
export function isDark(color: string) {
|
|
64
63
|
const [h, , l] = rgb2hsl(color);
|
|
65
64
|
|
|
66
65
|
return (h < 198 && l >= 0.5) || (h >= 198 && l >= 0.75);
|