Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

::add_to_color_scheme improvement #273

Closed
costa opened this issue Jul 18, 2024 · 1 comment · Fixed by #274
Closed

::add_to_color_scheme improvement #273

costa opened this issue Jul 18, 2024 · 1 comment · Fixed by #274
Assignees

Comments

@costa
Copy link
Contributor

costa commented Jul 18, 2024

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
@abinoam
Copy link
Collaborator

abinoam commented Jul 28, 2024

I think this addition doesn't change any previous behavior. So I would welcome a PR as it sounds a good idea. Could you please add tests along the PR? I can help you with any doubt in the code base. Sorry for taking so long to answer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants