Skip to content

Fixed color brightness calculation - #178

Open
swarty wants to merge 2 commits into
masterfrom
color-brightness-calculation-fix
Open

Fixed color brightness calculation#178
swarty wants to merge 2 commits into
masterfrom
color-brightness-calculation-fix

Conversation

@swarty

@swarty swarty commented Sep 1, 2026

Copy link
Copy Markdown

according to https://www.w3.org/WAI/WCAG22/Techniques/general/G145 standart of brightness calculation fixed missed blue layer in the formula.

@swarty swarty self-assigned this Sep 1, 2026
@swarty
swarty requested review from plegner and a lite review from Copilot September 1, 2026 13:02

Copilot AI 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.

Pull request overview

Fixes the Color.brightness calculation to correctly include the blue channel per WCAG (G145) guidance, and documents the reference used.

Changes:

  • Corrected brightness formula to use this.b instead of mistakenly reusing this.g.
  • Expanded the brightness getter JSDoc to include a link to the WCAG technique reference.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/colors.ts Outdated
Comment on lines +61 to +63
/** Get the brightness of this color.
* docs: https://www.w3.org/WAI/WCAG22/Techniques/general/G145
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants