Coder Social home page Coder Social logo

vscolors's Issues

Add support for modern colour formats

When I highlight rgba(10 10 10 / 10%), right-click, and choose "Color to HSL", I get an error saying "Can't resolve color format of rgba(10 10 10 / 10%)".

I have to change it to the legacy format rgba(10, 10, 10, 0.1), at which point I can convert it. It generates hsla(0, 0%, 4%, 0.1), which is also the legacy format.

But this generates a Stylelint violation "Expected 0.1 to be 10% (alpha-value-notation)". If I make that change, I get "Expected modern color-function notation (color-function-notation)".

Stylelint is expecting the modern format: hsla(0deg 0% 4% / 10%); examples are at the link above. (It appears that the deg is required by a separate rule: hue-degree-notation.)

Would it be possible for the extension to:

  1. read the modern formats, and
  2. have an option to write colours in the modern formats rather than the legacy ones? (It would probably be a good idea to have a second option to control whether to use deg in angles, too.)

Convert HEX without '#'

Hey @kevscript, how are you?
Great extension, it's the only color format converter
that really worked perfectly for me.

I'm having a bit of trouble with HEX colors.
When you double click a text to select the color to convert,
VS Code does not include the hashtag character.

Example:

Double click the string:

"#C9533E",

Right click, convert to RGB:

image

Do you think it would be possible to:
remove the '#' character from the regex,
when converting back, replace the selection + 1 character to the left?

Since 'rgb' and 'hsl' both have the name strings before,
it's very distinguishable from HEX colors, it could work.

If you think it's a good idea or there's a better solution, let me know and I can PR it. =)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.