Is there anyway to change the color schemes for Rstudio? It comes with 6 or 7 default, pre-packaged
For skan & others, useful intel can be had in the links posted elsewhere in the thread; on linux I found (backing up & then) opening your nearest-favourite theme in /usr/lib/rstudio/resources/themes/ as admin and editing colours to suit worked great. Chaos theme, for example, lacks the highlighting element whereby selecting a group of characters will highlight other instances of those in the file (e.g. an object). Textmate theme has this so I copied the block & changed the colour accordingly. If anyone's interested, at line55,
.ace_marker-layer .ace_selected-word {
background: #141414;
border: 1px solid #FF0000;
}
If you make a backup of your file (in linux, /usr/lib/rstudio/resources/themes/chaos.rstheme), RStudio may magically switch to the backup, meaning any changes you make don't get applied. Evidently it doesn't populate the themes list based on filenames in the folder.
Also, colours given as #123 will accept #123456 HEX. I'm not sure what the #123 format is.
There's a much faster way to deal with this and 100% doable.
Open RStudio with your favourite Editor theme and open an .R
script
Inspect the Source layout (Right-click>Inspect) and Ctrl + f an unique class selector such as .ace_comment
. In the matched CSS rules box in the side pane copy an attribute as unique as possible (i.e. color: #0088FF;
I use Cobalt theme).
Go to RStudio's install path and dive into /www/rstudio/
. As jorloff rightly said, you'll find a bunch of files like this: VERYUGLYNAME.cache.css
. Open all of them with your favourite text editor as administrator.
Find in files: Ctrl+ Shift + f (in sublime text) and type the unique attribute value you previously chosed. BOOM, there you have it.
Now delight yourself editing your crazy style, but remember to back it up first!
As Jonathan said, RStudio's editor is based on ACE themes, so all clases have the ace_
prefix. Take your time inspecting and understanding the editor hierarchy. I recommend you to take some time inspecting the html code to understand its structure. The editor starts in id="rstudio_source_text_editor"
I'm using RStudio Desktop 0.99.892 Release for Windows
i am new to R Studio and i would like to share how i was able to customize the color scheme of R Studio:
How to change the color of comments in Rstudio
Unfortunately there's not currently a way to do this. RStudio's themes are based on themes for the ACE text editor, which it embeds. It can generate internal themes based on ACE themes, so if you have an ACE theme you'd really like to use with RStudio, you can submit a pull request to RStudio (which is hosted on GitHub) for consideration.
Not able to add a comment. Having read all the replies and comments, and tried a few things seems interesting. Here is what works for me.
I am using RStudio 1.0.136. According to all the posts, right click on the Editor -> Inspect. The Web Inspector comes up and shows the Elements tab. Then click the Sources tab, select "Only enable for this session", click "Enable Debugging" button. You will see the code for the theme xxxxxxx.cache.css file. If nothing in the editor, try the left top "Show Navigator" button right under the "Elements" menu. Select the .css file in the list and it should open.
My line number seems dim. So changed color: #222;
to color: #818222;
in this section: (forgive my bad color sense). And you can see the color change right away! How amazing!
.ace_gutter {
background-color: #3d3d3d;
background-image: -moz-linear-gradient(left, #3D3D3D, #333);
background-image: -ms-linear-gradient(left, #3D3D3D, #333);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#3D3D3D), to(#333));
background-image: -webkit-linear-gradient(left, #3D3D3D, #333);
background-image: -o-linear-gradient(left, #3D3D3D, #333);
background-image: linear-gradient(left, #3D3D3D, #333);
background-repeat: repeat-x;
border-right: 1px solid #4d4d4d;
text-shadow: 0px 1px 1px #4d4d4d;
color: #818222;
}
@skan mentioned selected words are too dim. I have the same problem. So here I found it:
.ace_marker-layer .ace_selected-word {
border-radius: 4px;
border: 8px solid #ff475d;
box-shadow: 0 0 4px black;
}
I changed border: 8px solid #ff475d;
. It is now very bright, or may be too bright. Anyway, it works. Thanks for every one. And hope this can help.
This is for current session only. Now you know which .css to modify and what you should do, it will be easy to modify the original .css file to keep it permanent.
I found a hack to do this in RStudio
0.99.879 on the Mac.
In /Applications/RStudio.app/Contents/Resources/www/rstudio/
there are a bunch of files with extension .cache,.css
. These are the files holding the themes' formats. Since the names aren't descriptive I had to experiment to find which one went with the theme I wanted to edit.
I wanted to modify the TextMate theme, so here are my steps:
.ace_comment {color: rgb(255,255,0);}