jeff-hykin / code-eol

💾 ⭐️ An extension to display line endings in VS Code
https://marketplace.visualstudio.com/items?itemName=sohamkamani.code-eol
MIT License
19 stars 4 forks source link

RGBA not working as color setting #2

Closed aksh1618 closed 5 years ago

aksh1618 commented 6 years ago

Setting the setting code-eol.color to an RGBA value (#RRGGBAA or #RGBA) makes it render as white.

jeff-hykin commented 6 years ago

Sadly yes, it doesn't work with alpha, only officially works with #RGB. I know this is pretty annoying (rgba is the first thing I tried) especially since this is for white space characters.

It is likely because the default JavaScript setter for CSS values is limited to RGB, instead of RGBA. The alpha is set separately in JavaScript, so there may be a way to add transparency through that method. As soon as I get a chance I'll work on implementing it, and if it is difficult I'll add a notification/notice that rgba isn't supported so no one else wastes time trying to get it working.

aksh1618 commented 6 years ago

Yes, I tried searching VS Code's API Docs, but couldn't find anything related to alpha. They do however support rgba in inbuilt settings such as the editorWhitespace.foreground setting, so there is a way, but maybe they haven't exposed it or are using a workaround.

jeff-hykin commented 5 years ago

It took me awhile to take a look into this, but I finally did and I found a way to enable opacity!

The vs code documentation actually says it doesn't support it; (see "ThemableDecorationAttachmentRenderOptions" on https://goo.gl/SYzyg8), but I tried adding an "opacity" field anyways and it worked!

Along with opacity I added support for all the customization options that vs code supports (see "ThemableDecorationAttachmentRenderOptions" on https://goo.gl/SYzyg8)

You're still not able to add a rgba() option, but in settings you can do

"code-eol.style": { 
    "color": "#000000", 
    "opacity": 1.0 
}