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.

4 or 8 digit hex color codes are not recognized

See original GitHub issue

Description

Hexadecimal color codes using exactly 4 digits/places are not recognized in Sublime Text Buffers. E.g.: #0000 which would mean “complete transparency”.

Those 4 digit codes are valid color codes in CSS.

Support Info

I am using Sublime Text v3.1.1 build 3176 with ColorHelper v2.5.1

  • ST ver.: 3176
  • Platform: linux
  • Arch: x64
  • Plugin ver.: 2.5.1
  • Install via PC: True
  • mdpopups ver.: 3.3.4
  • markdown ver.: 2.6.11
  • pygments ver.: 2.1a0
  • jinja2 ver.: 2.8

Steps to Reproduce Issue

  1. Open a source file with color codes inside. The codes with 3 or 6 digits should get recognized.
  2. Type in a color code with exactly 4 digits. E.g.: #F00F (should equal to pure red).
  3. See that the plugin does not recognize the correctly written color code and does not draw a color box.

This issue is kinda related to #26, but this is the reverse: Detecting compressed codes.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
facelessusercommented, Jan 17, 2019

CSS3 made sense at the time. All the colors were not supported fully in browsers at the time as I recall.

When I have time, if it isn’t already present, I’ll try to make the color_scanning behavior more clear.

1reaction
facelessusercommented, Dec 18, 2018

That is a CSS4 color convention. You’d have to enable CSS4 colors: http://facelessuser.github.io/ColorHelper/usage/#color_scanningallowed_colors.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Did you know there are 4 and 8 digit hex codes (#11223344 ...
10 years as a developer and somehow I have missed that there are 4 digit (#1234) and 8 digit (#11223344) hex codes for...
Read more >
8-digit hex is not a background-color value - css - Stack Overflow
I'd have to double-check the spec, but use 3 byte codes, instead. The 4th byte is used for the alpha (transparency) channel and...
Read more >
CSS 8 Digit Hex Colors - Quackit Tutorials
The CSS 8-digit hex color notation allows you to specify RGB colors using hexadecimal values, while at the same time, specifying its transparency....
Read more >
How to Read Hex Color Codes - Hexadecimal Color | Pluralsight
Then add the two totals together to equal 255. Recognize that the number 255 is the same as the RGB number 255, which...
Read more >
How to apply a color of #FF6D9700(8 DIGIT) hex code to a css ...
hexcode should always 6 digit code so this 8 digit code is not valid color, I am suggesting use color picker and convert...
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