Bug 1579364 Comment 3 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

(In reply to Richard Marti (:Paenglab) from comment #1)
> Yes, I can confirm this. But note, in TB 60 the text colours aren't calculated but hard coded in tagColors.css.

I'd like to first understand which part is hardcoded and which part isn't, before we dive into the calculations again. They were wrong before, indeed, but I'm quite sure they're corecct. The 0.179 threshold is derived from `Math.sqrt(1.05 * 0.05) - 0.05`, since we're always comparing contrast ratios of black vs. white text. So using a different constant here would essentially mean you're moving away from this boolean comparison towards different text colors.

If you want higher granularity to check different contrast types, you could use `var useBrightText = !backgroundColor.isContrastRatioAcceptable(new Color(0, 0, 0), "AAA");` - Where "AA" might already be enough contrast for tags in TB.
(In reply to Richard Marti (:Paenglab) from comment #1)
> Yes, I can confirm this. But note, in TB 60 the text colours aren't calculated but hard coded in tagColors.css.

I'd like to first understand which part is hardcoded and which part isn't, before we dive into the calculations again. They were wrong before, indeed, but I'm quite sure they're correct now. The 0.179 threshold is derived from `Math.sqrt(1.05 * 0.05) - 0.05`, since we're always comparing contrast ratios of black vs. white text. So using a different constant here would essentially mean you're moving away from this boolean comparison towards different text colors.

If you want higher granularity to check different contrast types, you could use `var useBrightText = !backgroundColor.isContrastRatioAcceptable(new Color(0, 0, 0), "AAA");` - Where "AA" might already be enough contrast for tags in TB.

Back to Bug 1579364 Comment 3