question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Alpha hex support

See original GitHub issue

#697 proposes single and double character hex color support (eg: #E would convert to #EEEEEE).

In the spirit of this, I’m proposing support for alpha hex support.

#FF000080

The extra two hex digits at the end would represent the alpha/opacity. LESS could convert this to:

rgba(255, 0, 0, 0.5)

Producing a pure red with 50% opacity.

Issue Analytics

  • State:open
  • Created 11 years ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
ashsearlecommented, Nov 17, 2017

Can this be reopened bearing in mind 4 and 8-digit hex are defined in CSS Color Module Level 4 and already supported in various browsers?

0reactions
LordPachelbelcommented, Jul 2, 2021

I don’t know when it happened, but at some point rgba() became able to convert #rrggbbaa colors to rgba().

Example: box-shadow: 0 3px 6px rgba(#00000029); will output as box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16078431);

It isn’t documented but it should be, so I did so in this pull request.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"alpha hexadecimal" | Can I use... Support tables for HTML5 ...
"Can I use" provides up-to-date browser support tables for support of front-end web technologies on desktop and mobile web browsers.
Read more >
How To Use CSS Hex Code Colors with Alpha Values
Learn how to use hex codes in CSS and change the transparency of the color by using an alpha value. An introduction to...
Read more >
Alpha Channel Support for CSS Hex Syntax Sample
Sample illustrating the use of Alpha Channel Support for CSS Hex Syntax. ... Starting with Chrome 52, hex color values can include an...
Read more >
Hexadecimal color code for transparency - gists · GitHub
Transparency is controlled by the alpha channel (AA in #AARRGGBB). Maximal value (255 dec, FF hex) means fully opaque. Minimum value (0 dec,...
Read more >
Browser Compatibility Testing of #rrggbbaa hex color notation
BROWSER SUPPORT FOR #RRGGBBAA HEX COLOR NOTATION. Google Chrome. #rrggbbaa hex color notation element is not supported by Chrome version 4 to 51....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found