lib/iroki/main/main.rb in iroki-0.0.27 vs lib/iroki/main/main.rb in iroki-0.0.28
- old
+ new
@@ -181,11 +181,12 @@
single_color: nil,
name_map_f: nil,
auto_color: nil,
display_auto_color_options: nil,
newick_f: nil,
- out_f: nil)
+ out_f: nil,
+ default_color: "black")
args = method(__method__).parameters.map { |arg| arg[1] }
AbortIf::logger.info "Args " + args.map { |arg| "#{arg} = #{eval(arg.to_s).inspect}" }.join(', ')
if display_auto_color_options
@@ -342,9 +343,21 @@
patterns = h
else
patterns = nil
end
+
+ # set default color if needed
+ if default_color && default_color != "black"
+
+ abort_if !default_color.hex? && !Iroki::Color::COLORS[default_color],
+ "--default-color must be a hex code (don't forget the '#' or a valid color. Got '#{default_color}'."
+
+ Iroki::Color::default_color_tag = { label: Iroki::Color.get_tag(default_color),
+ branch: Iroki::Color.get_tag(default_color), }
+ end
+
+
####################
# get color patterns
#################################################################