Giter Site home page Giter Site logo

enyancc / vscode-ext-color-highlight Goto Github PK

View Code? Open in Web Editor NEW
243.0 5.0 75.0 762 KB

Extension adds colored border around css/web colors in the editor

License: GNU General Public License v3.0

JavaScript 96.92% CSS 1.77% Less 0.23% SCSS 0.60% TypeScript 0.49%

vscode-ext-color-highlight's Introduction

This extension styles css/web colors found in your document.

Install

In VSC press Ctrl+Shift+P (Cmd+Shift+P on Mac) then type ">ext install", hit enter, search "Color Highlight".

Still confused? Click "Get Started" above.

Questionnaire

Please answer the questions in this questionnaire. Your feedback is very valuable and will help me improve this extension. https://goo.gl/forms/5emac4WyQv7CWZOK2

Contributors

Feel free to contribute!

vscode-ext-color-highlight's People

Contributors

adrone avatar brollins90 avatar chadgauth avatar curtisgibby avatar dependabot[bot] avatar enyancc avatar ferretwithaberet avatar julioc avatar kronuz avatar leochiu-a avatar logerfo avatar lucasmatuszewski avatar naumovs avatar robiot avatar tanhakabir avatar tessavwalstijn avatar thomcc avatar vizhe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

vscode-ext-color-highlight's Issues

Highlights non-color array keys in Drupal PHP code

For one reason or another, in Drupal, many predefined array keys start with a hash. This plugin highlights them if they happen to start with a string of characters that is a valid hex color, for example anything that starts with #default.

2016-02-29 at 10 52

Accidental highlighting of strings like "#1234567890"

Noticed that the parser sometimes sees a string like "#123456789" and highlights "#123456" as a color. The parser should probably be more strict, and not highlight it's not strictly in hex format (eg more than 6 characters or one of the values out of hex range).

Option to only show rectangle

Can you please add an option to only show the colour rectangle in front of the colour code/name? I don't actually want the colour value itself to get coloured. Too distracting.

Hex colors starting in 0x

Hello, is it possible to add support to hex color int starting in 0x? (Like 0xFFFFFF, equivalent to #FFFFFF) Thanks in advance!

Extention breaks VSCode's Extention Host when importing invalid files in SASS files

Reproduction:

@import " ";

This is enough to break VS Code's Extention Host, which results in all extentions breaking, including git control.

I get this behaviour

Also tested on Visual Studio Code Insiders (everything's the same, still breaks)


Update

If you only have one of the two extensions installed, the extension host does NOT crash, but combine them both and it does, which is annoying. I think that the root problem is coming from vscode-ext-color-highlight, because it's the one who's throwing the error.

Any way to resolve this?

The completely same issue has been asked on vscode-live-sass-compiler extension repo too. They too believe it's vscode-ext-color-highlight to blame, hence I'm posting this issue here.

Highlight variables in JS files?

Hi. Great plugin. I've seen numerous requests for highlighting sass variables, but none addressing JS variables. Is this meant to work by default? Is there an option that enables this functionality?

As you can see from the screenshot below, VSCode doesn't highlight the constants tomato etc. in the file.
screen shot 2018-12-05 at 17 24 56

Incorrect Stylus Variable Highlighting

Stylus variables aren't being highlighted correctly. For example, the $GRAY_* variables that have two-digit numbers here are all matched to $GRAY_1:

color-highlight-stylus-problem

Another issue worth noting in this image - the text for hsl(0, 0%, 100%) has white text on the white background, making it unreadable. It would be nice if it was black like the HEX values.

My software:

  • OS: Ubuntu 14.04
  • Visual Studio Code: 1.14.2
  • Color Highlight: 2.3.0

Please consider adding a CHANGELOG.md

Updates in VS Code don't tell us what has changed. You do have it in the readme, but enabling this feature follows the common pattern of putting in a CHANGELOG.md.

image

Please consider adding a CHANGELOG.md

Feature Request: Setting to disabled colors in scrollbar

I love this extension, especially with the new background setting.

However, I've found that it adds some sort of mini map in the scrollbar of all highlighted colors in my file:

Uploading Screen Shot 2016-08-12 at 12.09.03 PM.pngโ€ฆ

Can we get a setting to be able to disable this feature? I find it distracting and unnecessary.

Wrong highlighting in CSS

Have some CSS:
wrong_highlight
default

Extension highlight part of selector #bac. I think search must be inside {} and exclude selector names

Using:

  • Visual Studio Code 1.5.3
  • Color Highlight 1.2.1

support hex alpha

Could you add support for hex alpha?
It s as simple as changing your regex to support length 4 and 8.

Thanks!

It is not supported in stylus

It is not supported in stylus although i add this to settings

"color-highlight.languages": [
    "javascript",
    "scss",
    "css",
    "sass",
    "less",
    "php",
    "xml",
    "html",
    "json",
    "styl",
    "stylus"
  ]

Suggestion: recognize %23 as #

There are areas in data URIs where we might have colors, but they are not displayed because # are not supposed to be in data URIs.

image

hex highlight 0xffffff

Hi, its possible to add feature for detect code like 0xffffff ???

example

     var lineX_ = new PIXI.Graphics();
            console.log('lineX_: ', lineX_);
                lineX_.lineStyle(48, 0xffffff);
                lineX_.moveTo(0,0);
                lineX_.lineTo(1600*2, 0);
                lineX_.pivot.x = lineX_.width/2;
                lineX_.alpha = 0.4;

thanks

Show color of Sass variables?

Would it be possible to show the color of a Sass variable?
For example, if I have a variable declared like this in my Sass setup:

$primaryColor: #77baa8;

which is then used like this:

&.div { background-color: $primaryColor; }

It would be very handy if $primaryColor in the latter example got color highlighted with #77baa8

Colors right over selection highlight

Color definitions are colored right over the selection highlight, making it hard to tell what is selected, especially if it is only the color definition.

Here's an example:

highlight

Is it possible to use marker in a gutter?

I've recently switched to VSCode and i added this extension. Coming from Atom, i used Pigments which has an option to show colors in the gutter of the editor. Is it possible to implement something like this in Color Highlight?

i'm referring to this
Colors in gutter

it's do not work in '.vue'

yesterday, my vscode update to 1.10.1.

the color is not highlight in vue.

but it's work in last vscode version.

why?

(my english is poor , sorry

Colors non-colors

Hex sequences that are not colors get highlighted, too. Like this:

noncolor

wrong alpha RGBA reading for haxe/haxeflixel language

var color:FlxColor;
color.setRGB(0,204,255,255);
//this blue color R G B A , i need change alpha because sometimes
//i use variable earlier with other color

but extension show me nothing. look like the patterm ignore data if data have 4 incoming params, but take in case of 3 params. And replacing 0 to 0.5(float) destroy the marker placeholder. In python sometimes the color can have float values.
55555

white in white-space is colored

#text{
    white-space: pre-wrap;
}

White is colored white, but it should not be colored at all. White-space is the only CSS property with a color in its name, so (for now!) it would be safe to just append a negative lookahead for the dash in white-space (?!-) to the regex, like so:

const colorWeb = new RegExp('\\(' + preparedRePart + '\\)(?!-)', 'g');

see https://regex101.com/r/niLgcc/1 for an example of the negative lookahead.

And yes, I'm aware I can turn off word highlighting. Just thought I'd let you know of the problem :)

Disable highlighting of "word" colours?

Hey there, lovely extension

I'd love to be able to disable the highlighting of colour "words": grey, green, etc. while still highlighting the hex-codes in Javascript. This is because in React Native, we set variables for each colour hex-code that often overlap with the "CSS" definition of a colour word!

Color(220,220,220)

Very nice extension, thank you...
I am using a language with the following syntax (or look at the topic name):

color(#,#,#)

Could you add the color keyword so that the number arguments are colored? Much like how rgb(#,#,#) works, but replace 'rgb' with 'color'. Each number argument ranges from 0 to 255.

Thank you!

Support Sass

Can you make it support colours defined in Sass?

Currently some arbitrary Sass variables get coloured in but don't get a rectangle in front of them oddly enough. I suppose there's no "official" support for Sass, so if it could be added, awesome.

dot make selection and modification difficult

My prefered view is "dot". in fact i would love to have the square design like the native vscode one.

My issue is that when using the dot, it makes it very difficult to click and modify the entry. Mostly this is because when clicking on the dot it puts the cursor to the start of the line instead of to just before the dot.

I hope this can be fixed

Thanks

Update the Marketplace preview icon?

Hey, great extension! ๐Ÿ‘

I noticed that the highlighting looks quite different (a lot better in my opinion) than in the preview image used on the marketplace. Looks like this changed in #3, and the image wasn't updated?

Anyway, thought I'd mention it since you might get more installs with a newer image. ;)

Works with keyboard highlighted selections, but not mouse selected, for key macros

Regardless of highlight mechanism, using the alt-shift-P menu "Highlight Current" always works.

However, if I call the function highlightwords.addHighlight, it's not consistent.

I'm using some vim mappings to replicate my vim config:

    "vim.normalModeKeyBindingsNonRecursive": [
        {
            "before": ["<leader>", "m"],
            "commands": [
                "highlightwords.addHighlight"
            ]
        },
        {
            "before": ["<leader>", "M"],
            "commands": [
                "highlightwords.removeHighlight"
            ]
        },
        {
            "before": ["<leader>", "N"],
            "commands": [
                "highlightwords.removeAllHighlights"
            ]
        }
    ],

Using -m works only if I highlight using Shift-.

It does not work if I highlight using the mouse.

Highlight Color Variables?

Can you add highlighting for SASS color variables? My SASS package in Atom had this and I miss it.

I will love you forever.

Possibly highlight entire color?

Right now the plugin only creates a colored bordered around the color in question -- is it possible for there an option to change the background (and foreground, if necessary) of the color string? Something like pigments: https://atom.io/packages/pigments ?

It may just be a combination of my font / theme / syntax, but it's hard to read the text surrounded by the border and would be less obtrusive if it just highlighted the entire block of text.

Fails to load on new vscode

Since it doesn't support the new package.json Standard it fails to load on opening vscode.

EOENT: Error File not found: [..../package.json]

Support Visual Studio .vssettings 0xABGR format

Visual Studio .vssettings file uses 0xABGR format. Can this format be supported also?

<Item Name="Plain Text" Foreground="0x00DCDADA" Background="0x002D2A24" BoldFont="No"/>

Ignore Alpha and set it to 1.0

Color selector disappears

I must be missing something here, but when placing my mouse over a color, the color selector appears to the left, and then, upon moving my mouse to use it, the color selector disappears. Is there a keyboard shortcut or something to make edits inside the selector? Thanks.

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.