I guess the only way (maybe ?) you can do that is to define a custom scope
in your current color scheme (something that doesn’t clash with the scopes provided by existing syntax definitions for code highlighting). You can then assign a custom foreground
color to it.
If you have the PackageDev
package installed, you can simply select PackageDev -> Edit Current Color Scheme
to get a new split window. In the rules
array on the right side, you can then add a new entry.
For example :-
{
"scope": "preferred_name",
"foreground": "preferred_color"
}
Doing this & saving it should now give you access to the preferred_name
scope (in turn giving you the access to your choice of foreground
color) which can then be used as the scope
argument in the view.add_regions
API.
If you don’t want to install an additional package, you will need to create a file by the same name as that of your current color scheme in the User
directory and then put the rules
array in that & save it.