[R-SIG-Mac] colors from RGui in RStudio
peter dalgaard
pd@|gd @end|ng |rom gm@||@com
Thu Mar 5 11:57:18 CET 2020
Neither does any of the rest of us, I expect...
My guess is that first you need to
- figure out how to edit RStudio themes. Some hints here
https://support.rstudio.com/hc/en-us/articles/115011846747-Using-RStudio-Themes
It is not completely transparent how to proceed (e.g., where are the existing themes stored??),
but it looks like the standard themes are accessible if you take the hint and enter the online tmThemes editor.
- figure out which elements in RGui correspond to which elements in RStudio
- figure out how to translate the colors. I would expect that the colorWithDeviceRed are easy conversions to
hex code (multiply by 255, round, and use sprintf("%X", ...), for instance), after which you can just type them in.
E.g.,
colorWithDeviceRed:0.025 green:0.085 blue:0.600 alpha:1.0]
should become #061699
Dunno about colorWithCalibrated...
-pd
> On 5 Mar 2020, at 08:36 , Ivan Calandra <calandra using rgzm.de> wrote:
>
> Hi Simon,
>
> I do not know how I should use that...?
> Any more hint?
>
> Thanks!
> Ivan
>
> --
> Dr. Ivan Calandra
> TraCEr, laboratory for Traceology and Controlled Experiments
> MONREPOS Archaeological Research Centre and
> Museum for Human Behavioural Evolution
> Schloss Monrepos
> 56567 Neuwied, Germany
> +49 (0) 2631 9772-243
> https://www.researchgate.net/profile/Ivan_Calandra
>
> On 04/03/2020 23:15, Simon Urbanek wrote:
>> Mac-GUI$ grep -i colorWith *.m | grep -v //
>> FoldingSignTextAttachmentCell.m: [[col colorWithAlphaComponent:0.6f] setFill];
>> NoodleLineNumberView.m: normalBackgroundColor = [[NSColor colorWithCalibratedWhite: 0.95 alpha: 1.0] retain];
>> NoodleLineNumberView.m: foldedBackgroundColor = [[NSColor colorWithCalibratedWhite: 0.85 alpha: 1.0] retain];
>> NoodleLineNumberView.m: return [NSColor colorWithCalibratedWhite:0.42 alpha:1.0];
>> RController.m: [NSColor redColor], [NSColor grayColor], [NSColor purpleColor], [NSColor colorWithCalibratedRed:0.71f green:0.835f blue:1.0f alpha:1.0f], nil];
>> RController.m: [attr setObject:[Preferences unarchivedObjectForKey:selectionColorKey withDefault:[NSColor colorWithCalibratedRed:0.71f green:0.835f blue:1.0f alpha:1.0f]] forKey:NSBackgroundColorAttributeName];
>> RScriptEditorTextView.m: else shColorNormal=[NSColor colorWithDeviceRed:0.025 green:0.085 blue:0.600 alpha:1.0];
>> RScriptEditorTextView.m: else shColorString=[NSColor colorWithDeviceRed:0.690 green:0.075 blue:0.000 alpha:1.0];
>> RScriptEditorTextView.m: else shColorNumber=[NSColor colorWithDeviceRed:0.020 green:0.320 blue:0.095 alpha:1.0];
>> RScriptEditorTextView.m: else shColorKeyword=[NSColor colorWithDeviceRed:0.765 green:0.535 blue:0.035 alpha:1.0];
>> RScriptEditorTextView.m: else shColorComment=[NSColor colorWithDeviceRed:0.312 green:0.309 blue:0.309 alpha:1.0];
>> RScriptEditorTextView.m: else shColorIdentifier=[NSColor colorWithDeviceRed:0.0 green:0.0 blue:0.0 alpha:1.0];
>> RScriptEditorTextView.m: if (!c) c=[NSColor colorWithDeviceRed:0.71f green:0.835f blue:1.0f alpha:1.0f];
>> RScriptEditorTextView.m: else shColorBackground=[NSColor colorWithDeviceRed:1.0 green:1.0 blue:1.0 alpha:1.0];
>> RScriptEditorTextView.m: else shColorCurrentLine=[NSColor colorWithDeviceRed:0.9 green:0.9 blue:0.9 alpha:0.8];
>> RTextView.m: frameColor = [Preferences unarchivedObjectForKey:selectionColorKey withDefault:[NSColor colorWithCalibratedRed:0.71f green:0.835f blue:1.0f alpha:1.0f]];
>> RTextView.m: frameColor = [Preferences unarchivedObjectForKey:editorSelectionBackgroundColorKey withDefault:[NSColor colorWithCalibratedRed:0.71f green:0.835f blue:1.0f alpha:1.0f]];
>> RTextView.m: bgColor = [frameColor colorWithAlphaComponent:0.4];
>>
>>
>>
>>> On 4/03/2020, at 11:49 PM, Duncan Murdoch <murdoch.duncan using gmail.com> wrote:
>>>
>>> On 04/03/2020 3:08 a.m., Ivan Calandra wrote:
>>>> Dear Mac useRs,
>>>> When I was still working on Mac, I used to love the RGui, partly because
>>>> of the color codes. Now that I work on Windows, I use R through RStudio
>>>> but cannot find a color theme that gives the same colors as the Mac
>>>> RGui. I am not very familiar with CSS styles so I don't think I can
>>>> create one myself.
>>>> But I thought the Mac CSS style might be available somewhere, and that I
>>>> could use it in RStudio.
>>> The Mac R.app sources are available from https://cran.r-project.org/bin/macosx/Mac-GUI-1.70.tar.gz. However, I don't understand Cocoa apps enough to know where to look for the default colors.
>>>
>>> Duncan Murdoch
>>>
>>> _______________________________________________
>>> R-SIG-Mac mailing list
>>> R-SIG-Mac using r-project.org
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>>
>
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac using r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
--
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: pd.mes using cbs.dk Priv: PDalgd using gmail.com
More information about the R-SIG-Mac
mailing list