Skip to content

🔨 Split ColorUtils into ColorParser, ColorConversion, and ColorAccessibility#3941

Merged
guiyanakuang merged 2 commits intomainfrom
refactor/issue-3940-split-color-utils
Feb 24, 2026
Merged

🔨 Split ColorUtils into ColorParser, ColorConversion, and ColorAccessibility#3941
guiyanakuang merged 2 commits intomainfrom
refactor/issue-3940-split-color-utils

Conversation

@guiyanakuang
Copy link
Copy Markdown
Member

@guiyanakuang guiyanakuang commented Feb 23, 2026

Closes #3940

Summary

  • Split monolithic ColorUtils.kt (695 lines, 42 functions) into 3 focused modules following the Single Responsibility Principle:
    • ColorParser — CSS color string parsing (hex, RGB, RGBA, HSL, named colors)
    • ColorConversion — Color space conversions and formatting (RGB↔HSV, hex/RGB string output)
    • ColorAccessibility — Contrast detection, dark/light analysis, color lightening (WCAG)
  • Removed ~8 unused public functions (~120 lines of dead code)
  • Updated all 13 caller files and 2 test files with new imports

Test plan

  • ./gradlew ktlintFormat passes
  • ./gradlew app:desktopTest — all 209+ tests pass
  • Manual verification of color-related UI (side preview, color paste, HTML/RTF views)

@guiyanakuang guiyanakuang merged commit 3ba8978 into main Feb 24, 2026
2 checks passed
@guiyanakuang guiyanakuang deleted the refactor/issue-3940-split-color-utils branch February 24, 2026 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor ColorUtils into focused single-responsibility modules

1 participant