Skip to content

The Big Clock counts Home's dim and top gradient when it picks its text color - #460

Merged
McCal-Codes merged 3 commits into
mainfrom
clock-darkening
Oct 22, 2026
Merged

McCal-Codes merged 3 commits into
mainfrom
clock-darkening

Conversation

@McCal-Codes

Copy link
Copy Markdown
Owner

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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-21T17:20:41.099588Z 7b5a4a2 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Base automatically changed from clock-shade to main October 21, 2026 23:57
@McCal-Codes
McCal-Codes merged commit 9f94926 into main Oct 22, 2026
3 checks passed
@McCal-Codes
McCal-Codes deleted the clock-darkening branch October 22, 2026 00:17
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