Coder Social home page Coder Social logo

Alpha Transparency about colors HOT 4 CLOSED

radix-ui avatar radix-ui commented on May 18, 2024 1
Alpha Transparency

from colors.

Comments (4)

colmtuite avatar colmtuite commented on May 18, 2024 17

The idea is that the opaque and alpha scales are interchangeable, since they match almost perfectly.

Sometimes you need a color to be transparent, so it works well on coloured backgrounds for example. Let's say you have a text field with a light gray border, we'll use Mauve for this example. You use step mauve7 here for the border. That border will work well on a white background in light mode, or a dark background in dark mode.

But the border won't look great on a purple background for example. So you can use mauveA7, which is transparent. Now your text field border will work well on any background because it blends in, but it still looks the same as mauve7 on white/dark backgrounds.

Sometimes you need opaque colors, sometimes transparent. Now you have the option.

from colors.

binyamin avatar binyamin commented on May 18, 2024 2

@colmtuite Can you please explain this in the docs (on the website)?

from colors.

inwardmovement avatar inwardmovement commented on May 18, 2024 1

It would be great also to provide and example showing a visual comparison with/without alpha color, to show in what cases it's relevant to use the alpha version.

from colors.

PhilGarb avatar PhilGarb commented on May 18, 2024

Thank you for that explanation. That makes a lot of sense to me and sounds very helpful.

from colors.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.