Skip to content

fix: prevent infinite recursion in Score.score when no primary color found - #135

Open
DipCrai wants to merge 1 commit into
caelestia-dots:mainfrom
DipCrai:fix/score-infinite-recursion
Open

fix: prevent infinite recursion in Score.score when no primary color found#135
DipCrai wants to merge 1 commit into
caelestia-dots:mainfrom
DipCrai:fix/score-infinite-recursion

Conversation

@DipCrai

@DipCrai DipCrai commented Jul 16, 2026

Copy link
Copy Markdown

When all quantized colors have zero chroma (e.g. grayscale images), the Score.score() method recurses infinitely because primary stays None and the fallback calls itself with the same arguments.

Fix: return the highest-scored color as fallback instead of recursing.

…found

When all quantized colors have zero chroma (e.g. grayscale images),
the Score.score() method recurses infinitely because primary stays
None and the fallback calls itself with the same arguments.

Fix: return the highest-scored color as fallback instead of recursing.
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.

1 participant