问题
I'm using Googles excellent Code Prettify and I'm quite happy with it.
But: Does anybody happen to have a alternate CSS stylesheet so it'll render a bit more like Visual Studios default coloring? Green comments, red text/strings, etc.
回答1:
It took me a while but I replicated exactly my Visual Studio's color configuration. Enjoy.
.com { color: #008000; }
.str, .tag { color: #A31515; }
.kwd, .atv { color: #0000FF; }
.typ { color: #2B91AF; }
.lit, .atn { color: #FF0000; }
.pun, .pln { color: #000000; }
.dec { color: #800080; }
Comments are green, strings/tags reddish, keywords blue, types bluish, numbers red, punctuation black, declarations purple.
回答2:
I don't use Visual Studio so I don't know the color scheme but Prettify is easy enough to modify.
- Download the full version (not the small version, as the CSS has been minified)
- Open the prettify.css file in the src directory. There are 10 or so "elements" you can change the color of.
- Grab the hex values of each color out of Visual Studio (if available; if not, you could use a color picker app to obtain the hex values).
- Replace the color attribute for each element in the CSS file.
I'd throw it together myself really quick if I knew the colors but hopefully this helps!
来源:https://stackoverflow.com/questions/1667097/how-to-get-google-prettify-to-render-more-like-visual-studio