Hi everyone,I've googled for that for days, but I can't find any solution. Is there any possibility to color hexadecimal values (e.g. #FF0000) with it's value? Like on the screenshot. I know how to colorize the pattern, but I can't set the color value in the theme.
That would indeed be a nice feature, but to make it work I think there would need to be a scope, e.g. builtin.color.hex, that got special treatment in the syntax highlighting code.
I’d be happy if someone proved me wrong :)
/Per
20 okt. 2021 kl. 10:45 skrev Bartłomiej Jończy via TextMate textmate@lists.macromates.com:
Hi everyone, I've googled for that for days, but I can't find any solution. Is there any possibility to color hexadecimal values (e.g. #FF0000) with it's value? Like on the screenshot. I know how to colorize the pattern, but I can't set the color value in the theme.
<Screenshot 2021-10-20 at 10.44.04.png>
TextMate mailing list -- textmate@lists.macromates.com To unsubscribe send an email to textmate-leave@lists.macromates.com
Yes it's possible. via theme...
Uğur Özyılmazel
https://ugur.ozyilmazel.com https://github.com/vigo
On 20 Oct 2021 11:45 +0300, Bartłomiej Jończy via TextMate textmate@lists.macromates.com, wrote:
Hi everyone, I've googled for that for days, but I can't find any solution. Is there any possibility to color hexadecimal values (e.g. #FF0000) with it's value? Like on the screenshot. I know how to colorize the pattern, but I can't set the color value in the theme.
<Screenshot 2021-10-20 at 10.44.04.png> _______________________________________________ TextMate mailing list -- textmate@lists.macromates.com To unsubscribe send an email to textmate-leave@lists.macromates.com
OK, but how? I can set the foreground/background color, but how to set it not for the constant value but for the value captured in the language grammar?
On 20 Oct 2021, at 21:15, Uğur Özyılmazel ugurozyilmazel@gmail.com wrote:
Yes it's possible. via theme...
Uğur Özyılmazel
https://ugur.ozyilmazel.com https://github.com/vigo
On 20 Oct 2021 11:45 +0300, Bartłomiej Jończy via TextMate textmate@lists.macromates.com, wrote:
Hi everyone, I've googled for that for days, but I can't find any solution. Is there any possibility to color hexadecimal values (e.g. #FF0000) with it's value? Like on the screenshot. I know how to colorize the pattern, but I can't set the color value in the theme.
<Screenshot 2021-10-20 at 10.44.04.png> _______________________________________________ TextMate mailing list -- textmate@lists.macromates.com To unsubscribe send an email to textmate-leave@lists.macromates.com
AFAIK, you can’t. It would need some extra support in the core of TM. Unless of course you added all of the 2^24 possible hex values to the theme.
/Per
21 okt. 2021 kl. 15:11 skrev Bartu0142omiej Jou0144czy via TextMate textmate@lists.macromates.com:
OK, but how? I can set the foreground/background color, but how to set it not for the constant value but for the value captured in the language grammar?
On 20 Oct 2021, at 21:15, Uğur Özyılmazel ugurozyilmazel@gmail.com wrote:
Yes it's possible. via theme...
Uğur Özyılmazel
https://ugur.ozyilmazel.com https://github.com/vigo
On 20 Oct 2021 11:45 +0300, Bartłomiej Jończy via TextMate textmate@lists.macromates.com, wrote: Hi everyone, I've googled for that for days, but I can't find any solution. Is there any possibility to color hexadecimal values (e.g. #FF0000) with it's value? Like on the screenshot. I know how to colorize the pattern, but I can't set the color value in the theme.
<Screenshot 2021-10-20 at 10.44.04.png> _______________________________________________ TextMate mailing list -- textmate@lists.macromates.com To unsubscribe send an email to textmate-leave@lists.macromates.com
TextMate mailing list -- textmate@lists.macromates.com To unsubscribe send an email to textmate-leave@lists.macromates.com
https://lists.macromates.com/hyperkitty/list/textmate@lists.macromates.com/t...
There’s this old thread about adding the color to the gutter. It seems like it was left _just barely_ unfinished.
This would be a very useful feature when trying to make quick tweaks to a web hex color instead of having to jump into a browser’s dev tools or have to fire up Photoshop just to make minor color tweaks in CSS.
I like the idea of the gutter getting the color where the line number is. If it highlighted the color itself that would be fine, but it would probably require more coding to make sure the foreground text was visible based on the luminance of the color behind it. You’d probably need to set the color to white or black of the text to make it all legible.
Either way, +1 to add this as a core feature of TM. I would use it constantly for CSS. Would be great if it also worked in HTML and PHP files when doing inline CSS. Not sure if it could be made to work in a PHP echo, but anything would be beneficial as opposed to not having the feature.
J
On Oct 21, 2021, at 2:27 PM, Graham Heath via TextMate textmate@lists.macromates.com wrote:
https://lists.macromates.com/hyperkitty/list/textmate@lists.macromates.com/t... https://lists.macromates.com/hyperkitty/list/textmate@lists.macromates.com/thread/PNUTQABE7S5EPCUONY47LSVDLBDFPAMJ/
There’s this old thread about adding the color to the gutter. It seems like it was left _just barely_ unfinished.
-- Graham Heath On October 21, 2021 at 1:02:09 PM, Per Persson via TextMate (textmate@lists.macromates.com mailto:textmate@lists.macromates.com) wrote:
AFAIK, you can’t. It would need some extra support in the core of TM. Unless of course you added all of the 2^24 possible hex values to the theme.
/Per
21 okt. 2021 kl. 15:11 skrev Bartu0142omiej Jou0144czy via TextMate <textmate@lists.macromates.com mailto:textmate@lists.macromates.com>:
OK, but how? I can set the foreground/background color, but how to set it not for the constant value but for the value captured in the language grammar?
On 20 Oct 2021, at 21:15, Uğur Özyılmazel <ugurozyilmazel@gmail.com mailto:ugurozyilmazel@gmail.com> wrote:
Yes it's possible. via theme...
Uğur Özyılmazel
https://ugur.ozyilmazel.com https://ugur.ozyilmazel.com/ https://github.com/vigo https://github.com/vigo
On 20 Oct 2021 11:45 +0300, Bartłomiej Jończy via TextMate <textmate@lists.macromates.com mailto:textmate@lists.macromates.com>, wrote: Hi everyone, I've googled for that for days, but I can't find any solution. Is there any possibility to color hexadecimal values (e.g. #FF0000) with it's value? Like on the screenshot. I know how to colorize the pattern, but I can't set the color value in the theme.
<Screenshot 2021-10-20 at 10.44.04.png> _______________________________________________ TextMate mailing list -- textmate@lists.macromates.com mailto:textmate@lists.macromates.com To unsubscribe send an email to textmate-leave@lists.macromates.com mailto:textmate-leave@lists.macromates.com
TextMate mailing list -- textmate@lists.macromates.com mailto:textmate@lists.macromates.com To unsubscribe send an email to textmate-leave@lists.macromates.com mailto:textmate-leave@lists.macromates.com
TextMate mailing list -- textmate@lists.macromates.com mailto:textmate@lists.macromates.com To unsubscribe send an email to textmate-leave@lists.macromates.com mailto:textmate-leave@lists.macromates.com
TextMate mailing list -- textmate@lists.macromates.com To unsubscribe send an email to textmate-leave@lists.macromates.com
That would be great if the gutter could take the colour if the hex value is in the line. Even only the first occurrence (usually, the color definitions are one per line).
On 21 Oct 2021, at 20:27, Graham Heath via TextMate textmate@lists.macromates.com wrote:
https://lists.macromates.com/hyperkitty/list/textmate@lists.macromates.com/t... https://lists.macromates.com/hyperkitty/list/textmate@lists.macromates.com/thread/PNUTQABE7S5EPCUONY47LSVDLBDFPAMJ/
There’s this old thread about adding the color to the gutter. It seems like it was left _just barely_ unfinished.
-- Graham Heath On October 21, 2021 at 1:02:09 PM, Per Persson via TextMate (textmate@lists.macromates.com mailto:textmate@lists.macromates.com) wrote:
AFAIK, you can’t. It would need some extra support in the core of TM. Unless of course you added all of the 2^24 possible hex values to the theme.
/Per
21 okt. 2021 kl. 15:11 skrev Bartu0142omiej Jou0144czy via TextMate <textmate@lists.macromates.com mailto:textmate@lists.macromates.com>:
OK, but how? I can set the foreground/background color, but how to set it not for the constant value but for the value captured in the language grammar?
On 20 Oct 2021, at 21:15, Uğur Özyılmazel <ugurozyilmazel@gmail.com mailto:ugurozyilmazel@gmail.com> wrote:
Yes it's possible. via theme...
Uğur Özyılmazel
https://ugur.ozyilmazel.com https://ugur.ozyilmazel.com/ https://github.com/vigo https://github.com/vigo
On 20 Oct 2021 11:45 +0300, Bartłomiej Jończy via TextMate <textmate@lists.macromates.com mailto:textmate@lists.macromates.com>, wrote: Hi everyone, I've googled for that for days, but I can't find any solution. Is there any possibility to color hexadecimal values (e.g. #FF0000) with it's value? Like on the screenshot. I know how to colorize the pattern, but I can't set the color value in the theme.
<Screenshot 2021-10-20 at 10.44.04.png> _______________________________________________ TextMate mailing list -- textmate@lists.macromates.com mailto:textmate@lists.macromates.com To unsubscribe send an email to textmate-leave@lists.macromates.com mailto:textmate-leave@lists.macromates.com
TextMate mailing list -- textmate@lists.macromates.com mailto:textmate@lists.macromates.com To unsubscribe send an email to textmate-leave@lists.macromates.com mailto:textmate-leave@lists.macromates.com
TextMate mailing list -- textmate@lists.macromates.com mailto:textmate@lists.macromates.com To unsubscribe send an email to textmate-leave@lists.macromates.com mailto:textmate-leave@lists.macromates.com
TextMate mailing list -- textmate@lists.macromates.com To unsubscribe send an email to textmate-leave@lists.macromates.com
On Oct 21, 2021, at 13:02, Per Persson via TextMate textmate@lists.macromates.com wrote:
Unless of course you added all of the 2^24 possible hex values to the theme
Well, colors could be approximated by matching on the larger hextets for 2^12 patterns and scopes, e.g., this for all whitish values:
/#(f.f.f.|fff)\b/i
which correspond to the scope: `color.fff`
Quinn
Yes please!
I am salivating :-)-O
el
— Sent from Dr Lisse’s iPhone On 20. Oct 2021, 11:45 +0300, Bartłomiej Jończy via TextMate textmate@lists.macromates.com, wrote:
Hi everyone, I've googled for that for days, but I can't find any solution. Is there any possibility to color hexadecimal values (e.g. #FF0000) with it's value? Like on the screenshot. I know how to colorize the pattern, but I can't set the color value in the theme.
<Screenshot 2021-10-20 at 10.44.04.png> _______________________________________________ TextMate mailing list -- textmate@lists.macromates.com To unsubscribe send an email to textmate-leave@lists.macromates.com
Hi all,
I use for years now the following bundle command.
So create in your own (or new bundle) the following command:
- Go to Bundle Editor (⌃-⌥-⌘-B) (CTRL-OPT-CMND-B) - Into your own (or new) Bundle, create new command (⌘-N): choose command (see: https://feek.d.pr/7L7Yiq/ZvMqhk8685) - place in the code part the following code (see my gist): https://gist.github.com/feekApp/3d29b035d839b2665b921ac84f08fc52 - on the right side set the following settings: https://feek.d.pr/B07GgG/2gFInPLbwQ - on the "Semantic Class" set "callback.document.did-save, callback.document.did-open, callback.document.did-change-scm-status" in order to let the colors in the gutter update on save and change of the file - Add "source.css, source.css.less" to scope (or add other scopes you want)
Works perfectly for me: https://feek.d.pr/JCJiOM/85fpg8RAOp
== Feek
I also wanted to add, if you guys do add colorized hex values—be it in the gutter or as a background to the text itself (I think I’d prefer it behind the text itself resembling an inline-block, as opposed to the gutter, since we could have multiple color values on one line), it would also be very beneficial to make it work for CSS variables. All modern browsers support CSS variables now ( I think even Apple patched Safari a few versions ago to fix some glitches).
Example of what would be colored: :root { —my-sexy-color:#223344; } .some_div {background: var(—my-sexy-color); background:black; box-shadow 0 0 10px rgba(80,80,80,.5); color:#ffbb00}
If you have more than one color on a line, you can see in the attachment example how a gutter color would probably only show the first color attribute. There might be a bunch of colors, like if you’re styling form elements, in which case, a single color wouldn’t help much. You could change the gutter color to reflect where the cursor was, but I think a big block of color right behind the text itself would be simplest and best, it will stand out and make it easier to tweak than having to glance left.
I would suggest supporting #000000, #000, rgb(), rgba(), var(), —my-var, and named colors (white, black, red, etc). I don’t think opacity would be necessary for rgba() as it’s heavily dependent on what’s behind it, but I wouldn’t be opposed to it.
Gradients would be overkill, but coloring the individual color values in gradients would be nice.
Anyway, just my 2¢.