Closed MattDMo closed 3 years ago
No not removed, just different.
Here we override the css-level-4
color class options to export hex with uppercase.
"user_color_classes": {
"css-level-4": {
"output": [
{"space": "srgb", "format": {"hex": true, "upper": true}}, // <--- make hex upper case
{"space": "srgb", "format": {"comma": true}},
{"space": "hsl", "format": {"comma": true}},
{"space": "hwb", "format": {"comma": false}},
{"space": "lch", "format": {"comma": false}},
{"space": "lab", "format": {"comma": false}},
{"space": "display-p3", "format": {}},
{"space": "rec2020", "format": {}},
{"space": "prophoto-rgb", "format": {}},
{"space": "a98-rgb", "format": {}},
{"space": "xyz", "format": {}}
]
}
},
@gir-bot remove s: triage @gir-bot add T: support
String output options are discussed in coloraide
documentation. ColorAide is used to provide color conversion, CSS string parsing, and CSS output.
I should probably do a better job at documenting this area... 🤔
I'm sorry, I see you are are talking about ahex, so maybe update argb
color class.
I also need to rename the color class 0xahex
to 0xhex
...that was a typo.
I think I'll add a FAQ section in the docs that explains things like this a bit more. I imagine this will be a somewhat common question.
So I put this in my user settings:
"user_color_classes":
{
"css-level-4": {
"output": [
{"space": "srgb", "format": {"hex": true, "upper": true}}, // <--- make hex upper case
]
}
}
but it's still outputting lowercase.
This is a .sublime-color-scheme
file, if it matters.
I need maybe some more info. Looks like you are using color schemes? If so, you'll want to specify sublime-colormod
as the color class, and provide all the output options. It overrides at the top level (output
) not down at the individual level of each value in options
.
For clarity:
"sublime-colormod": {
"output": [
{"space": "srgb", "format": {"hex": true, "upper": true}},
{"space": "srgb", "format": {"comma": true, "precision": 3}},
{"space": "hsl", "format": {"comma": true, "precision": 3}}
]
},
That doesn't seem to be working either...
Let me confirm as I confirmed the first example worked.
Settings:
"user_color_classes": {
"sublime-colormod": {
"output": [
{"space": "srgb", "format": {"hex": true, "upper": true}},
{"space": "srgb", "format": {"comma": true, "precision": 3}},
{"space": "hsl", "format": {"comma": true, "precision": 3}}
]
}
},
Results:
@MattDMo please let me know what files you are editing and what the rule for the file you are editing looks like.
Your screenshot looks like a sublime-color-scheme
file which is why I suggested sublime-colormod
, but then you mentioned in the opening post you modified ahex.py
, so I don't know which color class to suggest you edit.
Also, check out https://github.com/facelessuser/ColorHelper/pull/182 which has a draft that explains all of this a bit better and maybe will help you figure out what you are getting wrong.
OK, I got it. It was an issue with braces in my settings, the "sublime_colormod"
key ended up syntactically being outside of "user_color_classes"
. It's working great now, thanks!
I'll check out #182 when I get a chance.
Please read and fill out this template by replacing the instructions with appropriate information. If the template is not followed, the issue will be marked
Invalid
and closed.Before submitting an issue search past issues and read the area of the documentation related to your specific question, issue, or request.
Description
... what is the issue / request ?
74 was an issue with
"upper_case_hex": true
not working in the 2.x series, and it was fixed by 4d03c04. However, that code seems to have been completely removed in 3.x. I fixed it by editing line 62 incustom/ahex.py
to the following:(changing the lowercase
{:02x}
s to{:02X}
).This won't work for everyone, as it now forces all hex output to be uppercase. Adding extra code to look for
"upper_case_hex"
in the settings as well as in the parameters passed to the function hopefully won't be too difficult, I just haven't had a chance to do it yet.Support Info
...
Steps to Reproduce Issue