Repository navigation
The Big Clock counts Home's dim and top gradient when it picks its text color - #460
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7b5a4a216a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (alpha <= 0f) return this | ||
| val keep = (1f - alpha.coerceIn(0f, 1f)) | ||
| val light = keep.toDouble().pow(2.2).toFloat() | ||
| fun RegionStats.dim() = RegionStats(mean * light, p15 * light, p85 * light, r * keep, g * keep, b * keep) |
There was a problem hiding this comment.
Preserve scrim variation when updating luminance percentiles
When a clock overlaps the top or bottom scrim falloff, alphaOver returns the average alpha for the entire box and this line applies it uniformly to p15 and p85. The actual scrim varies by vertical position, so the brightest pixels can be near the un-darkened inner edge while the code lowers them as though they received the average darkness. For a pale or mixed wallpaper this overstates white contrast and can remove or weaken the clock's shade even though the real p85 pixels remain bright; transform samples according to their position or conservatively adjust the relevant percentiles instead of scaling both by the mean alpha.
Useful? React with 👍 / 👎.
Builds on the clock shade PR (this branch includes its commit, so merge that one first).
The Big Clock now counts Home's own dim (dark appearance dims wallpaper) and the top gradient when it picks its text color, since those darken the picture the clock sits on. A picture measured by Smart clock ink already has them in it, so it is not darkened twice.
Checked: HomeDarkeningTest, unit tests and lint. Not checked on the phone.