Skip to main content
edited tags
Link
Michael E2
  • 258.7k
  • 21
  • 370
  • 830
Tweeted twitter.com/StackMma/status/1534097839470649344
Became Hot Network Question
Source Link

Change color of text in comments inside Input cell

I've made my research in how to change the color of comments inside an input cell. I've tried it all and nothing seems to work as it should.

First, I am using a Stylesheet, not the default looking Notebook (where I can, indeed, change the color). Here, the default settings don't work. This is expected.

Now, to change the color I first tried to do it within the notebook itself by selecting a color in Format>TextColor with a comment selected. It does not work.

I then went to the StyleSheet editor to forcedly change the color via code. My input cell style looks like this:

Cell[StyleData["Input"],CellDingbat->"\[Wolf]", Background->RGBColor[0.12156862745098039`, 0.12156862745098039`,0.12156862745098039`], AutoStyleOptions>{"CommentStyle" -> {FontWeight -> Bold,FontColor -> RGBColor[0.75,0.73,0]}}] 

(That RGB is a yellow-like color)

This should totally do it, but it doesn't. It only changes the color of comment's "braces" (* *).

The color of the text inside the comment remains unchanged, only the "(* *)" changed to the yellow-like color I wanted.

As the image below shows: (you can ignore the actual code, just pay attention to the comments)

enter image description here

What should I do?