How I can get a theme color and apply to a style? #190
Replies: 3 comments
-
It looks like you are trying to define colors in the lexer itself which is probably not going to work. Instead set the background color you want in your theme file. |
Beta Was this translation helpful? Give feedback.
-
As noted in the documentation[1], you generally should not specify colors in lexers. If you do, you need to specify an actual color from `lexer.colors`, not a derived color from a style (e.g. `lexer.styles.*.fore` will not work). This is due to the internal implementation of style references and not something that can easily be explained. As an example, the 'diff' lexer defines styles with colors[2].
[1]: https://orbitalquark.github.io/textadept/api.html#styles-and-styling
[2]: https://github.com/orbitalquark/scintillua/blob/530810c22ab92b2dbc0e0e627a5b9de3cd236475/lexers/diff.lua#L21
|
Beta Was this translation helpful? Give feedback.
-
Understood, I'll focus on other areas on the lexer and drop this ideia then. Thanks for the replies! |
Beta Was this translation helpful? Give feedback.
-
Hello, thanks for making such useful editor, I really like it! :]
I'm trying to apply a background using theme colors, but it always uses a black background, my code (I'm trying to use
keyword
just for testing):Using Textadept 11.3
Example:
For instance, it works if I use the one of the base16 colors:
Looking at the base16 module, I noticed that it contains a
fore
fieldBut trying to access
fore
also doesn't works, but it's just invisible instead of black:Note: I'm trying to mimic nelua-sublime's yellow background for preprocessor context.
Beta Was this translation helpful? Give feedback.
All reactions