solarized icon indicating copy to clipboard operation
solarized copied to clipboard

TeXShop color scheme

Open johannesjh opened this issue 13 years ago • 13 comments

Please add a TeXshop color scheme.

TeXShop is a popular LateX editor for Mac OS X. Its colors can be edited using Apple's default system, e.g. as described in this blogpost http://www.jkwchui.com/2010/03/subdued-texshop-color-scheme/

Solarized light color scheme for TeXShop: Run these commands in the OSX Terminal application to change TeXShop's color scheme to solarized light:

# solarized light color scheme

# background = solarized base3 = 253 246 227
defaults write TeXShop background_R 0.99
defaults write TeXShop background_G 0.96
defaults write TeXShop background_B 0.89

# commands = solarized red = 220  50  47
defaults write TeXShop commandred 0.86
defaults write TeXShop commandgreen 0.196
defaults write TeXShop commandblue 0.184

# comments = solarized base1 = 147 161 161
defaults write TeXShop commentred 0.58
defaults write TeXShop commentgreen 0.63
defaults write TeXShop commentblue 0.63

# foreground = solarized base00 = 101 123 131
defaults write TeXShop foreground_R 0.40
defaults write TeXShop foreground_G 0.48
defaults write TeXShop foreground_B 0.51

# index = solarized magenta = 211  54 130
defaults write TeXShop indexred 0.83
defaults write TeXShop indexgreen 0.21
defaults write TeXShop indexblue 0.51

# marker = solarized cyan = 42 161 152
defaults write TeXShop markerred 0.165
defaults write TeXShop markergreen 0.63
defaults write TeXShop markerblue 0.596

# insertionpoint = solarized base00 = 101 123 131
defaults write TeXShop insertionpoint_R 0.40
defaults write TeXShop insertionpoint_G 0.48
defaults write TeXShop insertionpoint_B 0.51

To use the solarized dark color scheme, run the following commands in the OSX Terminal application:

# solarized dark color scheme

# background = solarized base03 = 0  43  54
defaults write TeXShop background_R 0.00
defaults write TeXShop background_G 0.169
defaults write TeXShop background_B 0.212

# commands = solarized red = 220  50  47
defaults write TeXShop commandred 0.86
defaults write TeXShop commandgreen 0.196
defaults write TeXShop commandblue 0.184

# comments = solarized base01 = 88 110 117
defaults write TeXShop commentred 0.345
defaults write TeXShop commentgreen 0.043
defaults write TeXShop commentblue 0.459

# foreground = solarized base0 = 131 148 150
defaults write TeXShop foreground_R 0.514
defaults write TeXShop foreground_G 0.580
defaults write TeXShop foreground_B 0.589

# index = solarized magenta = 211  54 130
defaults write TeXShop indexred 0.83
defaults write TeXShop indexgreen 0.21
defaults write TeXShop indexblue 0.51

# marker = solarized cyan = 42 161 152
defaults write TeXShop markerred 0.165
defaults write TeXShop markergreen 0.63
defaults write TeXShop markerblue 0.596

# insertionpoint = solarized base0 = 131 148 150
defaults write TeXShop insertionpoint_R 0.514
defaults write TeXShop insertionpoint_G 0.580
defaults write TeXShop insertionpoint_B 0.589


Note that due to a bug in TeXShop, changing the foreground color does currently not work. The lighter color scheme still remains usable, but the dark scheme with black foreground text is really ugly.

The bug is even documented in the TexShop help system, see TeXShop Help Panel > How do I configure TeXShop > Hidden Preference Items: "[The foreground and insertionpoint color settings] have not worked since version 2.10. They will be fixed eventually, but probably not in the immediate future."

Related bug tickets can be found on TexShop's sourceforge tracking system, see http://sourceforge.net/tracker/index.php?func=detail&aid=1678501&group_id=155796&atid=797238 http://sourceforge.net/tracker/index.php?func=detail&aid=1505331&group_id=155796&atid=797238

As a final note: To restore the default color settings that comes with TeXShop, you can either delete your ~/Library/Preferences/TeXShop.plist file (which will reset all your prefences!) or run the following commands:

# restore the default settings that come with TeXShop

defaults write TeXShop background_R 1.0
defaults write TeXShop background_G 1.0
defaults write TeXShop background_B 1.0

defaults write TeXShop commandred 0.0
defaults write TeXShop commandgreen 0.0
defaults write TeXShop commandblue 1.0

defaults write TeXShop commentred 1.0
defaults write TeXShop commentgreen 0.0
defaults write TeXShop commentblue 0.0

defaults write TeXShop foreground_R 0.00
defaults write TeXShop foreground_G 0.00
defaults write TeXShop foreground_B 0.00

defaults write TeXShop indexred 1.00
defaults write TeXShop indexgreen 1.00
defaults write TeXShop indexblue 0.00

defaults write TeXShop insertionpoint_R 0.00
defaults write TeXShop insertionpoint_G 0.00
defaults write TeXShop insertionpoint_B 0.00

defaults write TeXShop markerred 0.02
defaults write TeXShop markergreen 0.51
defaults write TeXShop markerblue 0.13

=> Can you please add these shell scripts to the solarized source code, so that other users may benefit from them.

johannesjh avatar Jan 04 '12 11:01 johannesjh

Thanks! This is quite useful.

agmarrugo avatar May 16 '12 07:05 agmarrugo

Very useful, thank you!

helderco avatar May 29 '12 15:05 helderco

Very useful, thanks!

joshuawwy avatar Nov 15 '12 07:11 joshuawwy

Thanks for this. BTW the foreground color bug seems to be fixed as these scripts work for me with TexSchop 3.11

leingang avatar Feb 11 '13 04:02 leingang

:+1: Thanks! btw I wrote a simple Ruby script for easier switching ;) https://github.com/DonSchado/texshop-colorizer

DonSchado avatar Mar 15 '13 10:03 DonSchado

Thank you very much johannesjh, I have used the scripts and made my own custom scheme. I thought I might share it here:

defaults write TeXShop background_R 0.94 defaults write TeXShop background_G 0.86 defaults write TeXShop background_B 0.96

defaults write TeXShop foreground_R 0.00 defaults write TeXShop foreground_G 0.00 defaults write TeXShop foreground_B 0.4

defaults write TeXShop commentred 0.8 defaults write TeXShop commentgreen 0.0 defaults write TeXShop commentblue 0.4

defaults write TeXShop commandred 0.165 defaults write TeXShop commandgreen 0.63 defaults write TeXShop commandblue 0.596

defaults write TeXShop indexred 0.83 defaults write TeXShop indexgreen 0.21 defaults write TeXShop indexblue 0.51

defaults write TeXShop markerred 1.0 defaults write TeXShop markerblue 0.0 defaults write TeXShop markergreen 0.0

rosaAdl avatar May 27 '13 14:05 rosaAdl

Thanks for the tip! I noticed one error in the solarized dark color scheme.

defaults write TeXShop commentgreen 0.043

should be

defaults write TeXShop commentgreen 0.431

because 110 / 255 = 0.431. If you use the original value, your comments come out a very dark and almost unreadable purple. With the corrected value they're a nice dark gray, as intended.

mactyr avatar Aug 06 '13 00:08 mactyr

Yet another Solarized light theme (Preview). The dark background line is TexShop highlighting the content inbetween matching brackets.

# Solarized colors (name, r, g, b)
#     base03    0.0000  0.1686  0.2118
#     base02    0.0275  0.2118  0.2588
#     base01    0.3451  0.4314  0.4588
#     base00    0.3961  0.4824  0.5137
#      base0    0.5137  0.5804  0.5882
#      base1    0.5765  0.6314  0.6314
#      base2    0.9333  0.9098  0.8353
#      base3    0.9922  0.9647  0.8902
#     yellow    0.7098  0.5373  0.0000
#     orange    0.7961  0.2941  0.0863
#        red    0.8275  0.0039  0.0078
#    magenta    0.8275  0.2118  0.5098
#     violet    0.4235  0.4431  0.7686
#       blue    0.1490  0.5451  0.8235
#       cyan    0.1647  0.6314  0.5961
#      green    0.5216  0.6000  0.0000

# background = base3
defaults write TeXShop background_R 0.9922
defaults write TeXShop background_G 0.9647
defaults write TeXShop background_B 0.8902

# commands = blue
defaults write TeXShop commandred 0.1490
defaults write TeXShop commandgreen 0.5451
defaults write TeXShop commandblue 0.8235

# comments = base1
defaults write TeXShop commentred 0.5765
defaults write TeXShop commentgreen 0.6314
defaults write TeXShop commentblue 0.6314

# foreground = base01
defaults write TeXShop foreground_R 0.3451
defaults write TeXShop foreground_G 0.4314
defaults write TeXShop foreground_B 0.4588

# \index terms = yellow
defaults write TeXShop indexred 0.7098
defaults write TeXShop indexgreen 0.5373
defaults write TeXShop indexblue 0.0000

# marker = magenta
defaults write TeXShop markerred 0.8275
defaults write TeXShop markergreen 0.2118
defaults write TeXShop markerblue 0.5098

# insertionpoint = base02
defaults write TeXShop insertionpoint_R 0.0275
defaults write TeXShop insertionpoint_G 0.2118
defaults write TeXShop insertionpoint_B 0.2588

# Highlighted background = base03
defaults write TeXShop highlightContentRed 0.0000
defaults write TeXShop highlightContentGreen 0.16863
defaults write TeXShop highlightContentBlue 0.21176

# Highlighted brace color = magenta
defaults write TeXShop highlightBracesRed 0.8275
defaults write TeXShop highlightBracesGreen 0.2118
defaults write TeXShop highlightBracesBlue 0.5098

kilburn avatar Mar 20 '15 14:03 kilburn

This is a Monokai style tentative.

# Monokai-ish dark color scheme

# background = 39 40 34 (#272822)
defaults write TeXShop background_R 0.15
defaults write TeXShop background_G 0.16
defaults write TeXShop background_B 0.13

# commands = 102 217 239 (#66D9EF)
defaults write TeXShop commandred 0.4
defaults write TeXShop commandgreen 0.85
defaults write TeXShop commandblue 0.94

# comments = 117 113 94 (#75715E)
defaults write TeXShop commentred 0.46
defaults write TeXShop commentgreen 0.44
defaults write TeXShop commentblue 0.36

# foreground = 248 248 242 (#F8F8F2)  
defaults write TeXShop foreground_R 0.97
defaults write TeXShop foreground_G 0.97
defaults write TeXShop foreground_B 0.95

# index = 253 151 31 (#FD971F)
defaults write TeXShop indexred 0.99
defaults write TeXShop indexgreen 0.59
defaults write TeXShop indexblue 0.12

# marker = 73 72 62 (#E6DB74)
defaults write TeXShop markerred 0.90 
defaults write TeXShop markergreen 0.86
defaults write TeXShop markerblue 0.45

# insertionpoint = 248 248 240 (#F8F8F0)
defaults write TeXShop insertionpoint_R 0.97
defaults write TeXShop insertionpoint_G 0.97
defaults write TeXShop insertionpoint_B 0.94

# highlighted background = 73 72 62 (#49483e)
defaults write TeXShop highlightContentRed 0.27 
defaults write TeXShop highlightContentGreen 0.29
defaults write TeXShop highlightContentBlue 0.24

# highlighted brace color = 249 38 114 (#f92672)
defaults write TeXShop highlightBracesRed 0.98
defaults write TeXShop highlightBracesGreen 0.15
defaults write TeXShop highlightBracesBlue 0.45

llsaull avatar Aug 16 '15 13:08 llsaull

Safari Reader Night Theme safari night theme

# Safari Reader Night Theme

# background = 39 40 34 (#272822)
defaults write TeXShop background_R 0.05
defaults write TeXShop background_G 0.06
defaults write TeXShop background_B 0.03

# commands = 102 217 239 (#66D9EF)
defaults write TeXShop commandred 0.3
defaults write TeXShop commandgreen 0.70
defaults write TeXShop commandblue 0.93

# comments = 117 113 94 (#75715E)
defaults write TeXShop commentred 0.46
defaults write TeXShop commentgreen 0.44
defaults write TeXShop commentblue 0.36

# foreground = 248 248 242 (#F8F8F2)  
defaults write TeXShop foreground_R 0.71
defaults write TeXShop foreground_G 0.71
defaults write TeXShop foreground_B 0.71

# index = 253 151 31 (#FD971F)
defaults write TeXShop indexred 0.99
defaults write TeXShop indexgreen 0.59
defaults write TeXShop indexblue 0.12

# marker = 73 72 62 (#E6DB74)
defaults write TeXShop markerred 0.90 
defaults write TeXShop markergreen 0.86
defaults write TeXShop markerblue 0.45

# insertionpoint = 248 248 240 (#F8F8F0)
defaults write TeXShop insertionpoint_R 0.97
defaults write TeXShop insertionpoint_G 0.97
defaults write TeXShop insertionpoint_B 0.94

# highlighted background = 73 72 62 (#49483e)
defaults write TeXShop highlightContentRed 0.27 
defaults write TeXShop highlightContentGreen 0.29
defaults write TeXShop highlightContentBlue 0.24

# highlighted brace color = 249 38 114 (#f92672)
defaults write TeXShop highlightBracesRed 0.98
defaults write TeXShop highlightBracesGreen 0.15
defaults write TeXShop highlightBracesBlue 0.45

LogicaEns avatar Oct 26 '15 10:10 LogicaEns

Hi,

Here is a ruby script made by someone. I can't remember who wrote this code, but it was really helpful for me.

# encoding: utf-8
module Colors
  def colorize(text, color_code)
    "\033[#{color_code}m#{text}\033[0m"
  end

  { :black    => 30,
    :red      => 31,
    :green    => 32,
    :yellow   => 33,
    :blue     => 34,
    :magenta  => 35,
    :cyan     => 36,
    :white    => 37
  }.each do |key, color_code|
    define_method key do |text|
      colorize(text, color_code)
    end
  end

  def solarized_light
    [
      'background_R 0.99',
      'background_G 0.96',
      'background_B 0.89',
      'commandred 0.86',
      'commandgreen 0.196',
      'commandblue 0.184',
      'commentred 0.58',
      'commentgreen 0.63',
      'commentblue 0.63',
      'foreground_R 0.40',
      'foreground_G 0.48',
      'foreground_B 0.51',
      'indexred 0.83',
      'indexgreen 0.21',
      'indexblue 0.51',
      'markerred 0.165',
      'markergreen 0.63',
      'markerblue 0.596',
      'insertionpoint_R 0.40',
      'insertionpoint_G 0.48',
      'insertionpoint_B 0.51',
    ].each do |setting|
      `defaults write TeXShop #{setting}`
    end
  end

  def solarized_dark
    [
      'background_R 0.00',
      'background_G 0.169',
      'background_B 0.212',
      'commandred 0.86',
      'commandgreen 0.196',
      'commandblue 0.184',
      'commentred 0.345',
      'commentgreen 0.431',
      'commentblue 0.459',
      'foreground_R 0.514',
      'foreground_G 0.580',
      'foreground_B 0.589',
      'indexred 0.83',
      'indexgreen 0.21',
      'indexblue 0.51',
      'markerred 0.165',
      'markergreen 0.63',
      'markerblue 0.596',
      'insertionpoint_R 0.514',
      'insertionpoint_G 0.580',
      'insertionpoint_B 0.589',
    ].each do |setting|
      `defaults write TeXShop #{setting}`
    end
  end

  def default_colors
    [
      'background_R 1.0',
      'background_G 1.0',
      'background_B 1.0',
      'commandred 0.0',
      'commandgreen 0.0',
      'commandblue 1.0',
      'commentred 1.0',
      'commentgreen 0.0',
      'commentblue 0.0',
      'foreground_R 0.00',
      'foreground_G 0.00',
      'foreground_B 0.00',
      'indexred 1.00',
      'indexgreen 1.00',
      'indexblue 0.00',
      'insertionpoint_R 0.00',
      'insertionpoint_G 0.00',
      'insertionpoint_B 0.00',
      'markerred 0.02',
      'markergreen 0.51',
      'markerblue 0.13'
    ].each do |setting|
      `defaults write TeXShop #{setting}`
    end
  end

  def custom_colors
    [
      'background_R 0.00',
      'background_G 0.169',
      'background_B 0.212',
      'commentred 0.4',
      'commentgreen 0.4',
      'commentblue 0.4',
      'commandred 0.1',
      'commandgreen 0.3',
      'commandblue 0.9',
      'foreground_R 0.9',
      'foreground_G 0.9',
      'foreground_B 0.9',
      'indexred 0.83',
      'indexgreen 0.21',
      'indexblue 0.51',
      'insertionpoint_R 1.00',
      'insertionpoint_G 0.00',
      'insertionpoint_B 0.00',
      'markerred 0.02',
      'markergreen 1.0',
      'markerblue 0.13'
    ].each do |setting|
      `defaults write TeXShop #{setting}`
    end
  end

end

include Colors

puts green("Type 'light', 'dark' or 'custom' for solarized color scheme (everything else will restore the default colors):")
STDOUT.flush
user_input = STDIN.gets.chomp

if user_input == 'light'
  solarized_light
elsif user_input == 'dark'
  solarized_dark
elsif user_input == 'custom'
  custom_colors
else
  puts red("restoring default color scheme")
  default_colors
end

curiale avatar Sep 20 '16 18:09 curiale

@curiale HAHA :D I think that was written by me... some time ago: https://github.com/DonSchado/texshop-colorizer

and actually it was linked here above ;)

DonSchado avatar Sep 20 '16 18:09 DonSchado

Is there any dracula-theme (https://draculatheme.com)?

avatar-lavventura avatar Feb 24 '18 11:02 avatar-lavventura