Resolve one word-diff background without turning transparent surfaces into black blends.
(contentBg: string, lineBg: string, signColor: string)
| 287 | |
| 288 | /** Resolve one word-diff background without turning transparent surfaces into black blends. */ |
| 289 | function resolveWordDiffHighlightBg(contentBg: string, lineBg: string, signColor: string) { |
| 290 | if (contentBg === TRANSPARENT_BACKGROUND || lineBg === TRANSPARENT_BACKGROUND) { |
| 291 | return contentBg; |
| 292 | } |
| 293 | |
| 294 | if (!isHexThemeColor(contentBg) || !isHexThemeColor(lineBg)) { |
| 295 | return contentBg; |
| 296 | } |
| 297 | |
| 298 | return hexColorDistance(contentBg, lineBg) >= MIN_WORD_DIFF_BG_DISTANCE |
| 299 | ? contentBg |
| 300 | : strengthenWordDiffBg(lineBg, signColor); |
| 301 | } |
| 302 | |
| 303 | /** Resolve the inline word-diff background, strengthening theme colors that are too subtle to see. */ |
| 304 | function wordDiffHighlightBg(kind: SplitLineCell["kind"], theme: AppTheme) { |
no test coverage detected