How to change the color pattern of codes (echo = True) in an Rmarkdown file? - colors

I'm generating a Rmarkdown file, showing the script (echo = TRUE) in the report. The code is shown in a color pattern, like in this image(https://i.stack.imgur.com/oAxON.png), with some in blue, some green, and some black. How can I choose a different color pattern? The green color looks not very readable. I would really appreciate any help! Thanks so much!
I tried changing the R preference - editor theme, but this does not change the color pattern in the knitted file. As this is not using the methods of color specification for plain text, I have no idea how to change this color pattern for reported codes themselves.

You have different highlighting styles, I found this gallery.
output:
html_document:
highlight: zenburn
On bookdown.org
highlight specifies the syntax highlighting style. Supported styles include "default", "tango", "pygments", "kate", "monochrome", "espresso", "zenburn", and "haddock". Pass null to prevent syntax highlighting.
Alternatively, you can look at different themes for the entire document, they come with different colour palettes for the output of source code.
https://prettydoc.statr.me/themes.html
https://github.com/juba/rmdformats
Looking into code decoration guidelines, I don't see a way to easily pick your own colours.
For default themes:
title: Nineteen Years Later
author: Harry Potter
date: July 31, 2016
output:
rmarkdown::html_document:
theme: lumen
To add a prettydoc theme, install the prettydoc package, just type the one you chose at the top of your document, as explained on the prettydoc home page.
title: Nineteen Years Later
author: Harry Potter
date: July 31, 2016
output:
prettydoc::html_pretty:
theme: cayman
highlight: github

Related

Highlight AppLocalizations.of(context) in Editor

When replacing strings with their translation equivalents, we lose the nice green color that made it easy to spot the strings.
For example:
In Text('Reply') the string 'Reply' is nice and green but when replaced with Text(AppLocalizations.of(context).reply) the new code is pretty much the same color as the rest of the code. It loses that ability to quickly glance and grasp structure.
Is there a way to get Android Studio to color AppLocalizations.of(context) green?

Orange Dot for Sublimetext3 dirty files

Modifying Preferences/Settings - User and adding: "highlight_modified_tabs":true, gets me highlighted TEXT in the tab for dirty files, but I cannot get the greyed out dot on the tab to change colors as well.
What I'm trying to accomplish is to have the dirty file dot change to orange like the text on the tab does by modifying the above settings, except I want only the dot to change color and not the text on the tab.
Answering my own question for those who may run into this issue.
After a lot of fiddling around, I figured out that within the Default.sublime-theme file on the lines describing the close file button which start at line 729 (for me at least) you will see a bunch of different code blocks that look like this:
{
"class": "tab_close_button",
"parents": [{"class": "tab_control", "attributes": ["dirty", "file_medium_dark"]}],
"layer0.opacity": 0.0,
"layer1.opacity": 0.0,
"layer2.opacity": 0.0,
"layer3.texture": "Theme - Default/dirty_circle_light.png",
"layer3.opacity": 0.5
},
There are several different blocks like the above that correspond to the tab_close_button class for the dirty attribute, presumably related to the background color of your theme. For me, running Tomorrow Night Eighties - I had to modify the above block which contained the reference code for whatever "file_medium_dark" may be (I just assumed medium_dark would catch my theme since it's, well ... medium dark).
You can apparently also change the dirty_circle or dirty_indicator png files directly, but I couldn't find good replacements on the web and when I tried to modify some directly in paint the results were weird - I would get a nice bright grey box housing the circle with the color I wanted instead of just the circle.
The change:
simply add into the above block "layer3.tint":[255,161,52] or whatever RBG color you want. Also, change the opacity from 0.5 to 1.0 or it will be very muted. One unintended consequence is that when you hover over the dirty file dot the 'x' will now be colored a translucent version of whatever color you set the dirty dot to, as opposed to the default light colored x. I'm sure there is a way to fix this that has to do with the dirty_x attributes but I'm tired of messing with it.
Also, not sure if this is relevant but some others on SO and various forums mentioned that making the change directly in the Default.sublime-theme file can have unintended consequences, and they advocated making a copy of this file within the packages/user folder and making the changes there, since apparently this file is loaded independently and applied after and on top of the default changes.

wxpython textctrl change caret colour

I'm using a wxpython textctrl & would like to hide the caret. After a lot of searching it would appear that the best approach would be to simply change it's colour to white. However I can not work out how to do this.
I found the following info:
SetCaretForeground(fore)
Sets the foreground color of the caret. The parameter fore is a wxColour object, a #RRGGBB string, or a color spec like "white". Returns None.
from here: http://www.yellowbrain.com/stc/caret.html#setfg
The code for my current textctrl is below. Any help would be appreciated.
self.control = wx.TextCtrl(self, style=wx.TE_MULTILINE | wx.TE_READONLY | wx.HSCROLL)
Clinton.
You are using a wx.TextCtrl and the link you give is for a wx.StyledTextCtrl. These are completely different animals, and the wx.StyledTextCtrl has a lot more functionality than the simple wx.TextCtrl.
I don't think there's a way to set the caret color in an ordinary wx.TextCtrl.

Sublime Text2 spell check color variation

I'm experiencing that Sublime Text 2 (ST2) changes colors of the words that are marked by the spell checker with a red snakeline underneath them. This behaviour happens as I scroll or type words, and the color switches between pitch black or radioactive green. It doesn't seem to be a pattern in the variations.
Examples:
Before color behaviour occurs: http://grab.by/hL6y
The radioactive green color behaviour: http://grab.by/hL6E
Anyone else experiencing this? It's quite freaking annoying. I'm on a 2012 Macbook pro retina with Mountain Lion, using the Solarized Dark colour scheme for ST2 (I've tried multiple, but same behaviour for all), and would love a fix! I've tried the Sublimetext.com forum, but nobody has a fix.
There may now be a viable workaround -- a spell check alternative.
https://github.com/phyllisstein/CheckBounce
The default syntaxes will need to be defined within the user configuration files. It now defaults to Markdown, Text, and Tex.
The built-in spell check of ST2 should be turned off when enabling the CheckBounce package.
The dictionary of words added in Mountain Lion is stored in:
/Users/insert_your_user_name_here/Library/Spelling/LocalDictionary

How to change error colors for Komodo IDE color scheme

I'm customizing color scheme, and almost everything working right.
Except command output tab is showing errors in red italic font, color settings for which I cannot find anywhere!
In font&color settings there are "fonts", "colors", "common syntax", "lang-specific" and "indicators" tabs, with drop-down selectors.
There is not one option that has red italic color assigned!!
Default font is white on blue.
Where could I find color settings for command output errors?
Well, nobody is answering, and I found a hack that helps.
It seems, that there's really no gui menu option for error text color in command output, but there is setting in .ksf file for it.
I changed manually line that says
'Errors': {'Error lines': {'fore': 65535, 'hotspot': 1, 'italic': 0}},
where 'fore' is the foreground color, 'italic' is italic font, to what I wanted, and it worked.
I suppose, 'hotspot' means it's clickable, but I don't sure/don't care now.
I know this is kinda late from the original post but I stumbled on this one while searching for this problem, it led me to the hint as to where to look in the GUI.
In version Komodo 9.0+
Preferences > Colour Scheme
Select the tab 'Language Specific'
Select the 'Language Errors' (underneath Others)
The Element type Error lines seems to reflect STDERR

Resources