highline icon indicating copy to clipboard operation
highline copied to clipboard

`::add_to_color_scheme` improvement

Open costa opened this issue 7 months ago • 1 comments

Hi, thanks for the useful gem. I've been using the following extension for a while, and if you like it too, I could make it into a PR or something.

class HighLine
  class << self
    def add_to_color_scheme(hash)
      old_hash = (color_scheme || {}).to_hash
      fail "Overlapping color schemes: #{old_hash.keys & hash.keys}"  unless
        (old_hash.keys & hash.keys).empty?
      self.color_scheme = ColorScheme.new(old_hash.merge hash)
    end
  end
end

costa avatar Jul 18 '24 04:07 costa