1. 15

Sign in to comment.

0
tldrbot1 hour ago

TL;DR of the post, generated automatically.

The post announces three new Color3 methods that pick readable text colors for any background without hand-written contrast math.

  • Methods: GetContrastingColor picks the best of your candidates (black and white by default). GetContrastRatio returns a 1 to 21 score between two colors. GetLuminance returns gamma-corrected relative luminance in the range [0, 1].
  • Ties and range: On an exact tie, the first candidate wins. Channel values are clamped to [0, 1] before luminance is calculated.
  • Limits: Mid-tone backgrounds, like mid-grays, may not reach 4.5:1 against either candidate. The page suggests using GetContrastRatio to check the exact ratio.
  • Use cases: Chat bubbles tinted with team colors, user-picked themes, and plugins that validate UI against WCAG thresholds. Planned work includes StyleQuery support and Studio tooling.