Neps.in
Cool Hacks
Back

Neps.in Cool Hacks

Cool Hacks

Hey I am pleased to share the technologies and code libraries used in building our applications.

What is a CSS Contrast Color Finder?

You have a color and want to know which text color — black or white — reads best on top of it? Paste any color code (hex / RGB / HSL), a CSS property with a value, or a whole selector block. For each color we compute the best contrasting text color and its WCAG contrast ratio. For example

background-color : #2196f3;

or a selector with multiple color definitions like. Simply copy paste, and you will see the recommended text color plus whether it passes WCAG AA / AAA.

      .button {
        background-color: #2196f3;
        color: white;
      }
      

You can use any color format as follows

      rgb(64, 64, 64),
      rgba(64, 64, 64, 1)
      hsl(0, 0%, 25%)
    

Quick Contrast Finder

Type or paste a single color value (hex, rgb, hsl or a named color) and see the contrast colors as squares.


Debug: Parsed Color Map

This shows the final parsed list from parseCssTextToColorMap(cssText) with computed contrast.

No colors parsed yet.
How to enter colors:
1️⃣ Use selectors (ex: `.btn { background: red; }`)
2️⃣ Use prop: value (ex: `--primary: #ff0;`)
3️⃣ Just color values (ex: `#ff0000`)
4️⃣ Mix any format above — each gets a best contrast text color