Sublime Forum

ColorHelper 3.0 Beta

#1

It’s been a long time coming, but the ColorHelper 3.0 Beta is now available. A number of issues were fixed, a number of things were improved. Some things got the axe, but also new features were added.

The goal was to make it perform better, to make it more flexible in regards to managing colors, and make maintaining the project less of a chore for me, so I don’t hide from giving the project the attention it deserves :smile: .

The new ColorHelper supports more color formats and more color spaces. Did you need the latest CSS syntax (rgb(0 0 0 / 1)? ColorHelper has you covered. Did you need it to support new spaces coming down the pipe like LCH and Lab? ColorHelper supports those.

We’ve even taught it some new tricks. Preview only on selection?

Want to play around with mixing colors?

What about comparing the contrast of colors (in sRGB, HSL, and HWB)?

You can pick up the beta on Package Control and try it out, but it is a beta, and there are a couple of steps. The dependency we need is not yet on Package Control, but we provide a channel repository file that will allow Package Control to locate and install it now. You also have to enable prereleases for ColorHelper. Instructions can be found here: https://facelessuser.github.io/ColorHelper/installation/#install-3.0-beta.

Give it a try. Let me know what you think, good, bad, or in between.

6 Likes

ColorHelper 2.0.0
#2

UPDATE: it works on ST 3211. False alarm.


Seems not working for ST 3211. (I didn’t encounter such an issue when I try it in my ST 4 setup)

I check the http_cache in Package Control’s cache, there IS coloraide in the cached json but somehow the following still happened

Package Control: The dependency 'coloraide' is not available

After manually install coloraide dependency (which I copied from my ST 4 setup), following errors appeared

Traceback (most recent call last):
  File "D:\_Download\Sublime Text Build 3211 x64\sublime_plugin.py", line 125, in reload_plugin
    m = importlib.import_module(modulename)
  File "./python3.3/importlib/__init__.py", line 90, in import_module
  File "<frozen importlib._bootstrap>", line 1584, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
  File "D:\_Download\Sublime Text Build 3211 x64\sublime_plugin.py", line 1199, in load_module
    exec(compile(source, source_path, 'exec'), mod.__dict__)
  File "D:\_Download\Sublime Text Build 3211 x64\Data\Installed Packages\ColorHelper.sublime-package\color_helper.py", line 9, in <module>
ImportError: cannot import name Color

Not sure it’s a PC issue or CH’s.

1 Like

#3

Did you restart after installing everything? I did perform this on a clean portable ST before making this public to make sure it worked, but a restart after installation is mandatory or things won’t load proper.

0 Likes

#4

Yes, but it remained same errors.

ImportError: cannot import name Color
0 Likes

#5

Let me double check that I ran this in ST3 and not ST4.

0 Likes

#6

I hit github API rate limit hence I installed coloraide manually after that. I would try later with a normal installation process.

0 Likes

#7

Yeah, the github rate limit is a problem. If you git clone it manually, you have to run Package Control’s install local dependency,

0 Likes

#8

ok. somehow it works now. I did nothing since then :slight_smile:

0 Likes

#9

Things will hopefully be smoother once the lib is in Package Control, but the process is slow at times, so this was the best way to start getting it into people’s hands sooner rather than later :slightly_smiling_face:.

2 Likes

#10

Just an update. The underlying coloraide dependency has been updated with a number of bug fixes. If PC doesn’t auto upgrade, you can force the update by running Package Control: Satisfy dependencies.

One thing to note, the current use of color functions color(srgb 1 0.5 0.3) doesn’t support percentages outside the alpha channel, but they should. The only reason I haven’t added such functionality is because, as is quite often the case, the CSS spec is a little unclear on how to properly handle the situation. With sRGB colors it works just fine, but using reference code by the CSS spec authors, there are some unclear cases.

For instance, the spec mentions color() should translate 0% - 100% to 0 - 1. But the reference library written by the spec authors has some weird cases:

// Reference library for latest color handling
new Color("color(srgb 100% 50% 30%)");
// Looks good: rgb(100% 50% 30%)
new Color("color(lab 100% 50 30)");
// What?! lab(1% 50 30)

So, maybe they are storing the data in the wrong format, maybe percent should be color space aware, maybe this is expected and you should only use percents with RGB like color spaces :man_shrugging:.

Needless to say, I expect some changes in this area to maybe occur in the future. I have an issue open to better understand the real intent here. Once I get that, I’ll probably add percent handling to color() and fix anything that isn’t working as expected.

1 Like

#11

One other small note. As previously noted, the CSS spec allows for certain colors to be specified as color(srgb 1 1 1), but it also allows fallbacks in case the system doesn’t support the color gamut:

color(display-p3 1 1 1, rgb(1 1 1))

ColorHelper will not currently recognize the color() portion when a fallback is specified, but it will see the rgb() fallback portion in the above case. The CSS spec doesn’t like to make things easy for us to handle efficiently. In general, this shouldn’t be too hard to implement, if everything was consistently handled. We are looking for single instances of valid colors, but the CSS spec allows this:

color(rec2020 1 1 1, display-p3 1 1 1, rgb(1 1 1))

So, we can already recognize rgb(), we could add handling for color(rec2020 1 1 1, /* fallbacks */) without too much issue, but now we have a new case where we have to recognize display-p3 1 1 1 which is invalid outside of color() but valid inside color(), but has no leading color( start. If they would just require the fallbacks to also be wrapped in color() this would be a fairly easy case to handle, but alas, this is not so.

I’m not quite sure how I want to approach this case in HTML and CSS, and frankly, we probably have a good while before browsers adopt this particular syntax, but I wanted to state this as a known case we don’t handle yet. We only handle simple color() cases with no fallbacks at this time.

1 Like

#12

Looks awesome. Thanks for your effort :slight_smile:
BTW: What color theme are you using? Looks nice.

0 Likes

#13

It’s my take on the Dracula Pro theme. I’ve never seen the actual Dracula Pro theme but using basic deduction, I was able to figure out the color palette, either that or I am really darn close.

I’m using the DAneo theme (I think it is Origin) but I use some custom overrides along with my personal take on the Dracula Pro color scheme built on top of Marian color scheme scopes. I have not purchased the Dracula Pro color scheme, and have never seen the actual original color schemes, but I think I’ve guessed at most everything pretty darn close.

I haven’t made the color scheme public just because I know they are charging for the official Dracula Pro, and I’m not sure if it would be appropriate on my part to release mine, but I do have a version of the classic Dracula available here, which like my Pro variant, is based on the Mariana scopes: https://github.com/facelessuser/sublime-dracula-theme. Because it is based on Mariana scoping and such and uses the new sublime-color-scheme format it works with Sublime Merge (which I also have a theme for: https://github.com/facelessuser/merge-dracula-theme).

Original Dracula theme can always be used and is found here: https://packagecontrol.io/packages/Dracula%20Color%20Scheme. It will not work with Sublime Merge and uses the old tmTheme format.

1 Like

#14

Interesting I see you’re a conaisseur too :smiley:
If you used your own math and color deduction it is perfectly fine to share it. I would change the naming though to something of your likings but basic colors compositions are not copyrightable as far as I know. I also purchased the Monokai Pro Theme and found free adaptions of it everywhere for Jetbrains IDEs or sublime themes. Monokai Pro is 9.95€ and compared to it the 99€ Zeno Rocha charges for Dracula Pro feels just like a rip off and a trend I personally don’t like.
You mind sharing your theme adoption (via PM is also fine)? I would be super hyped to try it out.

0 Likes

#15

Yeah, I think $10-ish is fine or even leave it open so that people can donate more if they just want to, but the current license is kind of ridiculous, especially since I suspect the themes are built on the backs of the open source themes available for classic, just with the new palette, but maybe I’m off base there.

With that said, something is only worth the asking price if people are willing to pay it, and people have paid it, so :man_shrugging:. If it works, it works. I’m not going to hate on the guy for making some money, I just think the asking price boggles the mind.


Basically, the Pro variants simply space the colors out geometrically and now use the same saturation and lightness across the palette. That and there are a number of different backgrounds for each variant. All of this info is provided in the actual site trying to sell the color scheme.

The homepage also almost gives away the entire palette in the giant colored circles that you select to show the different previews. The remaining colors can easily be deduced by looking at the color spacing and looking at the referenced images that show the colors.

I guess there are some colors that are harder to guess. For each variant, comments, selections, line highlight, seem to be some deviation of existing colors, I’m not sure if I got those exactly, but :man_shrugging:. Any colors outside the core palette I’m less concerned with. Each tool being themed may have UI elements that are styled a little different and are not part of the core palette. The only other colors are the backgrounds and there are images that show all those backgrounds.

All I care about is the palette. I don’t care how he chooses to scope the colors, I don’t need his font suggestions (really that is something he’s selling with it :man_facepalming:), or his ebook :man_shrugging:. I would gladly give him $10 bucks, but not what he’s asking.

Everything I shared is just from looking at the Dracula Pro homepage.

1 Like

#16

Awesome work on your repo. I ceated a pull request that has my take of a proish self deducted color scheme: https://github.com/gobijan/sublime-dracula-scheme

Feel free to accept or reject. I came up with those colors myself. And to be honest it’s just a color theme.

0 Likes

#17

I do understand. I’m still trying to decide what I think is appropriate. While I agree with your take in general, and I don’t personally agree with how he’s going about selling the color scheme, my way of showing appreciation is not getting in the way of him doing his thing.

I’m not looking to be the first guy blatantly throwing it out there. I’m kind of giving it time to see what happens generally. I’m 99% sure the official color palette has probably already leaked somewhere, though I haven’t looked to confirm that.

I’m not using their source, I’ve fine tuned my guesses over a period of time, I’m 90% sure I got the core colors nailed, or are at least within an imperceptible difference. And like you just figured out, he’s pretty much given in the official homepage all you need to know to cobble one together that is very close. I think in the end I’d be okay if I released it, but I’m not looking to be that first guy to test that out :slightly_smiling_face:.

3 Likes