Sublime Forum

[CSS, theme] use real colors to highlight colors props

#28

At first, thanks for advices. I really appreciate it.
Second, thanks you for digging into my code, I know how painful sometimes it can be.
I looked through your changes, the idea of naming regions is quite good.
And of course dozen of stupid bugs.
Merged.

0 Likes

#29

The whole naming the regions was actually out of necessity. I couldn’t clear some of the regions if the scope changed, but I could always clear a region if I knew its name. When editing a color, it looses its scope from time to time because you are removing characters. I tried to do delete the regions searching for the color scope as they were created, but it would miss the one that was being edited.

There is still one more issue I may try and track down. When editing a css color, it doesn’t always update or it updates too early (on RGB). Like if you are trying to enter 112 in the green channel, it will trigger on the 1 and ignore the 12.

0 Likes

#30

I found this bug. It was because of bugy optimization.
Now it always update colors and generate color theme only if necessary.
Pull from me.

0 Likes

#31

Cool. I will give it a try.

I actually find this plugin pretty useful. Thanks for the all the work on this.

0 Likes

#32

Just got around to trying it I think you must have made a change to writing the theme file.

Traceback (most recent call last): File "./sublime_plugin.py", line 143, in on_modified File "./css-colors.py", line 378, in on_modified File "./css-colors.py", line 306, in colorize_css File "./css-colors.py", line 261, in generate_color_theme File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plistlib.py", line 75, in readPlist pathOrFile = open(pathOrFile) IOError: [Errno 2] No such file or directory: u'/Users/facelessuser/Library/Application Support/Sublime Text 2/Packages/User/Colorized-766606182254614-Monokai Soda.tmTheme'

This causes the colors to all be white since it looks like it is failing to write the theme file.

0 Likes

#33

Hope last commit will fix this issue.
Before i delete previously colorized theme every time i apply new.
Now i do it only on init.

0 Likes

#34

I’ve got a fix comming. Hang tight for a pull request.

Your last commit fixed it, but I have a fix that cleans up extra files and fixes it.

0 Likes

#35

Pull requested. Now it works great! I will do some more testing in the next couple of days.

0 Likes

#36

why, #00 is white? I think this isn’t a good idea.

0 Likes

#37

It shouldn’t even catch such colors, since it’s not a valid hex color.

0 Likes

#38

wow, its working great so far! Thanks for your work.

0 Likes

#39

is it ready to use yet?

0 Likes

#40

The kind of coding I do for work is not web programming (we coding is more of a hobby for me), but from what limited testing I have been doing, I think it is safe to use.

There are a couple of items I think would be nice to have addressed before release though:

  • ** First:**
    The current commands available in the command palette are: css_colorize and css_uncolorize. I think they should be named using the common convention already used in the command palette: CSS Colors: Colorize and CSS Colors: Un-colorize. That way I can just use the name CSS Colors and find all available commands for the plugin.
  • Second:
    I think the colorize/uncolorize commands’ effects should be permanent. Currently if I invoke the uncolorize command, the effects only last until I edit a color, then everything becomes colorized again.
  • Third:
    Available in the menu under View is the menu item CSS dynamic highligting. This allows for a toggling of colorize/uncolorize that is permanent, but the menu item gives no indication of the current state of said toggling; it would be nice if there was some indication.
0 Likes

#41

Well i tried it and every time i enter a color, this pop up window appears with some error (check image in attachments)
After i press OK, it seems to show correctly but when i enter another color somewhere, again this error shows up, its pretty annoying :confused:
Any way to fix this?


0 Likes

#42

Hmm. Testing has been limited, and I haven’t looked into how Ask is handling the theme files. I have probably been testing with it in one of the scenarios that works. There is probably some more bugs to shake out. I am sure Ask has been looking into stuff like this.

Where is your theme file located? And are you using the latest commit?

0 Likes

#43

Its located in default folder - Packages\Color Scheme - Default
And about that, what does latest commit mean?

0 Likes

#44

Commit means: latest code submitted to Github.

So when I say latest, I just mean most recent code. The current code isn’t really released by versions, so that is what I mean.

0 Likes

#45

Oh that, yes i downloaded it maybe 15 minutes ago, and after that i posted the image.
It says there it was updated 2 days ago, it is this one right? https://github.com/a-sk/sublime-css-colors

0 Likes

#46

Yeah, you probably have the latest, can you look at your console output and see if there are any errors there? If so, post them here. I have a couple of bug fixes I will be pull-requesting myself. If there are more, maybe I can add them when I pull request again.

0 Likes

#47

This is the error, but it actually shows the same error 4 times in the console (in 4 rows)

---------------------------
Sublime Text 2
---------------------------
Error loading colour scheme Packages/D:\Documents and Settings\Risk0\Application Data\Sublime Text 2\Packages\Color Scheme - Default\Colorized-809529171364770-Putty.tmTheme: Error parsing plist xml: Failed to open file In file "Packages/D:\Documents and Settings\Risk0\Application Data\Sublime Text 2\Packages\Color Scheme - Default\Colorized-809529171364770-Putty.tmTheme"
---------------------------
OK   
---------------------------
0 Likes