IntelliJ Plugin Development - How to set background color for code block?
I am making an IntelliJ plugin that detects certain code convention violations. What I would like to do is color code the background of a block of code where a violation has been detected (see example below). I have found plenty of documentation for change foreground text (Annotators, Customer language support etc...), but no documentation on how to change the background of a block of code.
What I need is quite simple, given a start and end char position, I simply need to color-code the background of that chunk in a given color (and be able to remove the color coding later)
Example:

If anyone could point me to the appropriate documentation, or code examples of how to do this, it would be much appreciated. Thanks in advance.
Please sign in to leave a comment.
Text background can be changed in the same way as foreground. The code that works with text presentation usually uses TextAttributes class, which has methods to set both text foreground and background colors. E.g. if you work with annotators, you can use method Annotation.setTextAttributes to define text presentation.