@cloud-ru/ds-code-editor 1.0.3-preview-848e7fc1.0 → 1.0.3-preview-f76b4995.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/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
- // 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) {
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);