Permalink
Browse files

Make default color white if background is black; else black foregroun…

…d color
  • Loading branch information...
1 parent e5b23da commit 9c38ff6a34bfd8b8df144021cc61ae06147c4ca9 @drnic committed Nov 6, 2010
Showing with 4 additions and 4 deletions.
  1. +4 −4 Support/lib/copy_as_rtf.rb
@@ -84,10 +84,12 @@ def generate_stylesheet_from_theme(theme_class = nil)
@font_name = '"' + @font_name + '"' if @font_name.include?(' ') &&
!@font_name.include?('"')
+
theme_plist['settings'].each do | setting |
if (!setting['name'] and setting['settings'])
body_bg = setting['settings']['background'] || '#ffffff'
+ @body_bg ||= body_bg
body_fg = setting['settings']['foreground'] || '#000000'
selection_bg = setting['settings']['selection']
body_bg = hex_color_to_rtf(body_bg)
@@ -250,16 +252,14 @@ def current_style_as_rtf
def push_style name
cur = current_style
- # p "getting #{name}"
new_style = get_style_recursive(name.split('.'), @styles)
- # p "got #{new_style.inspect}"
# p "current: #{cur.inspect}"
new_style = cur.merge new_style if new_style
new_style ||= cur || {}
unless new_style[:color_index]
- new_style[:color_index] = 0 #45 # works for Sunburst theme; 0 for Eiffle or IDLE theme
+ #45 works for Sunburst theme; 0 for Eiffle or IDLE theme
+ new_style[:color_index] = (@body_bg == '#000000') ? 45 : 0
end
- # p "merged: #{new_style.inspect}"
@style_stack.unshift new_style
new_style
end

0 comments on commit 9c38ff6

Please sign in to comment.