0

Using this sample hex color #FF243447, I want to convert this to an RGBA since background-color seems to not support hex in ARGB. How can you achieve this without any library or javascript code? The page is very simple page but the hex color can be dynamic thus I can't simply get the rgba equivalent of this hex color to some website and statically put it inside rgba().

Bitwise DEVS
  • 2,858
  • 4
  • 24
  • 67
  • 1
    Does this answer your question? [Convert Hex to RGBA](https://stackoverflow.com/questions/21646738/convert-hex-to-rgba) – Camelopardalus Jun 12 '22 at 10:42
  • All the main modern browsers support the 8 hex digit notation and have done for some time. See https://caniuse.com/css-rrggbbaa can you put up an example snippet of code which shows the problem and also state which browser and system you are using. – A Haworth Jun 12 '22 at 10:43
  • @ThomasL. as I stated plain HTML and CSS only no JS – Bitwise DEVS Jun 12 '22 at 10:46
  • @AHaworth does it only support hex in rgba format and not argb? Thanks – Bitwise DEVS Jun 12 '22 at 10:50
  • I don’t understand what hex in RG a format means. You either have hex, like you have given in your question, or you have rgba. I’m afraid I’ve never heard of argb. – A Haworth Jun 12 '22 at 11:00
  • @AHaworth the above sample is hex in a ARGB order, if you put it exactly in HTML it will give you pinkish color instead of some sort of dark blue color when you put the first bytes which is "FF" at the end for alpha – Bitwise DEVS Jun 12 '22 at 11:04
  • Yes, I am lost as to what the question was as argb is not a thing as far as CSS is concerned. – A Haworth Jun 12 '22 at 11:14

1 Answers1

0

Silly stuff, the color above is an ARGB not RGBA. Moving the FF to the end fix the issue.

Bitwise DEVS
  • 2,858
  • 4
  • 24
  • 67