You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Color Converter: the contrast checker's colour pickers drop the alpha #428
The colour pickers next to "Text / Foreground" and "Surface / Background" in the contrast checker drop the alpha. Type #00000080 in the foreground field, click its swatch and pick any colour, and the field becomes #rrggbb, so the colour is fully opaque again and the contrast ratio and WCAG result change with it. The background picker does the same.
The main picker at the top keeps the alpha: handleNativeColorChange() in ColorConverterClient.tsx puts the current alpha back on the picked colour. The two contrast pickers call setFgInput(e.target.value) and setBgInput(e.target.value) directly (lines 510 and 555), so they skip that.
With #00000080, #00000080 and #ffffff80 in the three fields and #ff0000 picked on each swatch, I get #ff000080 for the main one and #ff0000 for foreground and background.
What did you expect?
The contrast pickers keep the alpha the same way the main picker does, so all three give #ff000080.
I'd make the alpha step in handleNativeColorChange() a small helper that takes the current parsed colour, use it for all three pickers, and add a case to ColorConverterClient.test.tsx that changes the foreground and background pickers and checks the alpha stays.
Browser and OS
Chrome on macOS
Checks
I searched existing issues and this is not a duplicate.
This does not include a real secret or token in the reproduction.
@anurag629 if this is worth fixing, could you assign it to me and add the hacktoberfest label? It's sharing the alpha step from the main picker with the two contrast pickers, plus a test. I'm waiting on two other issues, so I'll start it as soon as one of those frees up.
Hey @prakashNalla, confirmed, the two contrast pickers set the raw picked hex while the main one keeps the alpha. Sharing that alpha step sounds right. You're at two with #422 and codercops/chatcops#479, so this one's yours once one of those is merged, just say so here.
Activity
prakashNalla commentedon Oct 30, 2026
@anurag629 if this is worth fixing, could you assign it to me and add the hacktoberfest label? It's sharing the alpha step from the main picker with the two contrast pickers, plus a test. I'm waiting on two other issues, so I'll start it as soon as one of those frees up.
anurag629 commentedon Oct 30, 2026
Hey @prakashNalla, confirmed, the two contrast pickers set the raw picked hex while the main one keeps the alpha. Sharing that alpha step sounds right. You're at two with #422 and codercops/chatcops#479, so this one's yours once one of those is merged, just say so here.
prakashNalla commentedon Oct 30, 2026
@anurag629 #429 and codercops/chatcops#480 are both merged, so I'm free for this one. The fix is ready.
anurag629 commentedon Oct 30, 2026
Hey @prakashNalla, it's yours!