I'm trying to compare the colors of different websites.

One website states its colors with RGBA and has for example rgba(0, 0, 0, 0.55) on a white background. I would like to convert the result into a hex color code.

Is there a straightforward converter for this task?

I would expect a Web app, but otherwise for Windows 10.

  • For everyone trying to answer this question: a tool that allows entering 1 value only does not meet the requirements. Any tool needs to accept input for 2 values: an RGBA value and a background color. It then needs to put the alphaic value over the background and output the result. Dec 31, 2019 at 12:26
  • Just for convertion this can be helpful: cssgenerator.org/rgba-and-hex-color-generator.html
    – convert
    Jan 19, 2022 at 21:38

3 Answers 3


I don't know a fully-fledged solution for your case, but Linqpad can help. It's gratis and works on Windows 10.

The following script will convert merge an alpha color with a background color and output the resulting hex code:

// Define input here
var bgcolor = System.Drawing.Color.White;
var alphacolor =  System.Drawing.Color.FromArgb((int)(0.55*255), 0, 0, 0);

// Calculation
float factor = alphacolor.A / 255f;
int red = (int) (bgcolor.R * (1 - factor) + alphacolor.R * factor);
int green = (int) (bgcolor.G * (1 - factor) + alphacolor.G * factor);
int blue = (int) (bgcolor.B * (1 - factor) + alphacolor.B * factor);
var result = System.Drawing.Color.FromArgb(red, green, blue);

// Output as hex

For the given input rgba(0, 0, 0, 0.55) and white background, the result is


Hints: you need to convert decimal values like 0.55 using the formula (int)(<yourvalue>*255). This can only be omitted for the value 0, because the result is 0 as well in this specific case.


You can use this web for your color conversion. But while in rgba you have a value for transparency, in hex the isn't.

  • 1
    That's a nice tool but it doesn't really solve my problem of wanting to compare colors in this case. Is there a way where I can specify the background so that I get the resulting color when transparency gets factored in?
    – Christian
    Oct 3, 2017 at 9:35
  • 1
    @Christian Add those requirements to your Question. Oct 4, 2017 at 6:26

This tool should allow you to do this quite well for two colors.

It accepts html color names (e.g. black, white, dark red etc.), hex code (#fff, #000 etc.) and rgba colors (rgba(0.0,0.0,0.0,0.2) etc.)

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.