TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Creating color palettes with the CSS color-mix() function

22 pointsby danielskoglyabout 1 year ago

1 comment

bungabout 1 year ago
It&#x27;s a bit late on a Sunday night for me, but that said..<p>It strikes me as a bit odd that it automatically assumes you want alpha transparency if the percentages do not sum 100%. I can&#x27;t say I&#x27;d feel like I have some argument for why not. Maybe it&#x27;s just my gut feeling that is like, transparency is so much more declarative elsewhere like &quot;rgbA&quot;. I would have probably guessed it would be white or black by default.<p>It also strikes me as odd that you have to add a &quot;p2&quot; color&#x2F;parameter called &quot;transparent&quot; if you just want to make a color a bit transparent. Like if you&#x27;re going to automatically just force transparency as the default thing to choose for two colors which don&#x27;t sum as 100%, then why not do something similar here, default the third parameter so I can just do `color-mix(in srgb, blue 20%)`