Curses::COLOR_YELLOW, Curses::COLOR_BLUE,
Curses::COLOR_MAGENTA, Curses::COLOR_CYAN,
Curses::COLOR_WHITE, Curses::COLOR_DEFAULT]
- NUM_COLORS = 15
+ NUM_COLORS = (CURSES_COLORS.size - 1) * (CURSES_COLORS.size - 1)
DEFAULT_COLORS = {
:status => { :fg => "white", :bg => "blue", :attrs => ["bold"] },
:completion_character => { :fg => "white", :bg => "default", :attrs => ["bold"] },
:horizontal_selector_selected => { :fg => "yellow", :bg => "default", :attrs => ["bold"] },
:horizontal_selector_unselected => { :fg => "cyan", :bg => "default" },
- :search_highlight => { :fg => "black", :bg => "yellow", :attrs => ["bold"] }
+ :search_highlight => { :fg => "black", :bg => "yellow", :attrs => ["bold"] },
+ :system_buf => { :fg => "blue", :bg => "default" },
+ :regular_buf => { :fg => "white", :bg => "default" },
+ :modified_buffer => { :fg => "yellow", :bg => "default", :attrs => ["bold"] },
}
def initialize
@next_id = (@next_id + 1) % NUM_COLORS
@next_id += 1 if @next_id == 0 # 0 is always white on black
id = @next_id
- Redwood::log "colormap: for color #{sym}, using id #{id} -> #{fg}, #{bg}"
+ debug "colormap: for color #{sym}, using id #{id} -> #{fg}, #{bg}"
Curses.init_pair id, fg, bg or raise ArgumentError,
"couldn't initialize curses color pair #{fg}, #{bg} (key #{id})"
## delete the old mapping, if it exists
if @users[cp]
@users[cp].each do |usym|
- Redwood::log "dropping color #{usym} (#{id})"
+ warn "dropping color #{usym} (#{id})"
@entries[usym][3] = nil
end
@users[cp] = []
## to the default ones.
def populate_colormap
user_colors = if File.exists? Redwood::COLOR_FN
- Redwood::log "loading user colors from #{Redwood::COLOR_FN}"
+ debug "loading user colors from #{Redwood::COLOR_FN}"
Redwood::load_yaml_obj Redwood::COLOR_FN
end
fg = Curses.const_get "COLOR_#{ufg.upcase}"
rescue NameError
error ||= "Warning: there is no color named \"#{ufg}\", using fallback."
- Redwood::log "Warning: there is no color named \"#{ufg}\""
+ warn "there is no color named \"#{ufg}\""
end
end
bg = Curses.const_get "COLOR_#{ubg.upcase}"
rescue NameError
error ||= "Warning: there is no color named \"#{ubg}\", using fallback."
- Redwood::log "Warning: there is no color named \"#{ubg}\""
+ warn "there is no color named \"#{ubg}\""
end
end
Curses.const_get "A_#{a.upcase}"
rescue NameError
error ||= "Warning: there is no attribute named \"#{a}\", using fallback."
- Redwood::log "Warning: there is no attribute named \"#{a}\", using fallback."
+ warn "there is no attribute named \"#{a}\", using fallback."
end
end
end