Home/Tools/Colors/RGBA Generator
Colors · Generator

RGBA Generator

Generate RGBA, HEX8, and HSLA color values with an alpha transparency slider and live preview.

Color & Opacity

80%

Color Values

RGBArgba(99, 102, 241, 0.80)
HEX8#6366f1cc
HSLAhsla(239, 84%, 67%, 0.80)

Preview

On white

On dark

On color

Generated CSS
/* RGBA */
color: rgba(99, 102, 241, 0.80);

/* HEX8 */
color: #6366f1cc;

/* HSLA */
color: hsla(239, 84%, 67%, 0.80);
100%
Free, no
sign-up needed
0
Code written
by hand
85+
CSS tools
in one place
<1s
Copy-ready
CSS instantly
What is this

What is the RGBA Color Generator?

Generate RGBA colour values with opacity control. Pick your colour and alpha level, then copy the rgba() string ready for CSS.

Everything runs locally in your browser. Adjust the controls above, preview instantly, and copy clean, production-ready CSS — no account, no upload.

How to use

Using the RGBA Color Generator

Everything lives in the panel at the top of this page. There is nothing to install — it all runs right here in your browser.

1

Pick your base colour

Enter a HEX value or use the colour picker. The RGB components are calculated automatically.

2

Set the alpha value

Drag the opacity slider from 0 (fully transparent) to 1 (fully opaque). Common values: 0.1 for subtle tints, 0.5 for overlays, 0.9 for near-solid.

3

Copy the rgba() string

Click Copy to grab the complete rgba(r, g, b, a) value. Paste it directly as a colour value in any CSS property.

The output

What the generated code looks like

Clean, production-ready CSS — no vendor bloat, no unnecessary declarations.

styles.css
/* Overlays */
.overlay-dark   { background: rgba(0, 0, 0, 0.5); }
.overlay-light  { background: rgba(255, 255, 255, 0.15); }

/* Tinted surfaces */
.card-tinted    { background: rgba(108, 46, 245, 0.08); }
.border-subtle  { border-color: rgba(108, 46, 245, 0.2); }

/* Shadow with colour */
.card {
  box-shadow: 0 8px 32px rgba(108, 46, 245, 0.18);
}

Use RGBA for overlays, tinted surfaces, and coloured shadows - anywhere you need a colour at partial opacity.

Pro tips

Pro tips for better results

Use CSS custom properties to avoid repeating RGBA strings

Define --color-primary-rgb: 108, 46, 245 as raw RGB components, then use rgba(var(--color-primary-rgb), 0.1) to create tints at any opacity without redefining the colour.

rgba() and opacity are different

Setting opacity: 0.5 on an element makes the entire element (including children) semi-transparent. rgba() on background-color keeps children fully opaque. Use rgba() for tinted backgrounds.

Modern CSS supports rgb() with a slash for alpha

rgb(108 46 245 / 0.5) is equivalent to rgba(108, 46, 245, 0.5) in modern browsers (Chrome 65+, Firefox 52+, Safari 12.1+). Both forms work.

RGBA shadows add depth without hard edges

box-shadow: 0 4px 16px rgba(0,0,0,0.12) looks more natural than a solid-colour shadow. Keep alpha values between 0.06 and 0.2 for realistic depth.

FAQ

Frequently asked questions

rgba() sets the transparency of a single colour value - only that colour becomes semi-transparent. The opacity property makes the entire element and all its children transparent. Use rgba() when you want a tinted background but opaque text.
Yes, but there are two approaches. You can store the full rgba() string: --overlay: rgba(0,0,0,0.5). Or store raw RGB components: --color-rgb: 0,0,0 and compose with rgba(var(--color-rgb), 0.5). The second approach is more flexible.
No. All calculations run in your browser. Nothing is sent to a server.

From the blog

Read more