@cloud-ru/ds-code-editor 1.0.3-preview-d4c70f71.0 → 1.0.3-preview-fe0a44cc.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 +3 -1
- package/dist/cjs/constants.d.ts +1 -0
- package/dist/cjs/constants.js +1 -0
- package/dist/cjs/utils.d.ts +1 -1
- package/dist/cjs/utils.js +5 -4
- package/dist/esm/components/CodeEditor/CodeEditor.js +4 -2
- package/dist/esm/constants.d.ts +1 -0
- package/dist/esm/constants.js +1 -0
- package/dist/esm/utils.d.ts +1 -1
- package/dist/esm/utils.js +4 -3
- 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 +4 -2
- package/src/constants.ts +1 -0
- package/src/utils.ts +4 -3
package/src/utils.ts
CHANGED
|
@@ -57,9 +57,10 @@ export function rgb2hsl(htmlColor: string): [number, number, number] {
|
|
|
57
57
|
return [h, s, l];
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
//
|
|
61
|
-
//
|
|
62
|
-
|
|
60
|
+
// Возвращает true, когда фон СВЕТЛЫЙ («достаточно светлый, чтобы текст на нём был тёмным»).
|
|
61
|
+
// Пороги оттенка — по шкале 0–360. Прежнее имя isDark читалось ровно наоборот и уже привело
|
|
62
|
+
// к тому, что на светлой теме редактор получал базовую тему vs-dark.
|
|
63
|
+
export function isLightBackground(color: string) {
|
|
63
64
|
const [h, , l] = rgb2hsl(color);
|
|
64
65
|
|
|
65
66
|
return (h < 198 && l >= 0.5) || (h >= 198 && l >= 0.75);
|