<commit_before>module UI
  def self.Color(color)
    case color
    when String
      UI::Color.hex(color)
    when Symbol
      UI::Color.symbol(color)
    else
    when Array
      UI::Color.rgba(*color)
      color
    end
  end

  class Color
    def self.symbol(symbol)
      send("#{symbol}")
    end

    def self.hex(hex_color)
      hex_color.gsub!("#", "")

      colors =  case hex_color.size
                when 3
                  hex_color.scan(%r{[0-9A-Fa-f]}).map!{ |el| (el * 2).to_i(16) }
                when 6, 8
                  hex_color.scan(%r<[0-9A-Fa-f]{2}>).map!{ |el| el.to_i(16) }
                else
                  raise ArgumentError
                end

      if colors.size == 3<commit_msg>[iOS] more strict check on color type in UI::Color()<commit_after>module UI
  def self.Color(color)
    case color
    when String
      UI::Color.hex(color)
    when Symbol
      UI::Color.symbol(color)
    when Array
      UI::Color.rgba(*color)
    when UIColor
      color
    else
      raise ArgumentError
    end
  end

  class Color
    def self.symbol(symbol)
      send("#{symbol}")
    end

    def self.hex(hex_color)
      hex_color.gsub!("#", "")

      colors =  case hex_color.size
                when 3
                  hex_color.scan(%r{[0-9A-Fa-f]}).map!{ |el| (el * 2).to_i(16) }
                when 6, 8
                  hex_color.scan(%r<[0-9A-Fa-f]{2}>).map!{ |el| el.to_i(16) }
                else
                  raise ArgumentError
                end

      if colors.size == 3
{'fraction_non_alphanumeric': 0.12857142857142856, 'fraction_numerical': 0.01818181818181818, 'mean_word_length': 1.5640599001663893, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5411181', 'n_tokens_mistral': 547, 'n_tokens_neox': 505, 'n_words': 111}