<commit_before>//
//  UIColor+Hex.swift
//  ColorWithHex
//
//  Created by GabrielMassana on 18/03/2016.
//  Copyright © 2016 GabrielMassana. All rights reserved.
//
//  Credit: https://www.hackingwithswift.com/example-code/uicolor/how-to-convert-a-hex-color-to-a-uicolor
// 

import UIKit

public extension UIColor {
    
    //MARK: - Public method
    
    /**
     Creates UIColor object based on given hexadecimal color value (rrggbb), (#rrggbb), (rrggbbaa), (#rrggbbaa), (rgb) or (#rgb).
     
     - parameter hex: String with the hex information. With or without hash symbol.
     
     - returns: A UIColor from the given String.
    */
    public class func colorWithHex(hex: String) -> UIColor? {
        
        var color:UIColor? = nil
        
        let noHash = hex.stringByReplacingOccurrencesOfString("#", withString: "")
        <commit_msg>Method with extension for ObjectiveC<commit_after>//
//  UIColor+Hex.swift
//  ColorWithHex
//
//  Created by GabrielMassana on 18/03/2016.
//  Copyright © 2016 GabrielMassana. All rights reserved.
//
//  Credit: https://www.hackingwithswift.com/example-code/uicolor/how-to-convert-a-hex-color-to-a-uicolor
// 

import UIKit

public extension UIColor {
    
    //MARK: - Public method
    
    /**
     Creates UIColor object based on given hexadecimal color value (rrggbb), (#rrggbb), (rrggbbaa), (#rrggbbaa), (rgb) or (#rgb).
     
     - parameter hex: String with the hex information. With or without hash symbol.
     
     - returns: A UIColor from the given String.
    */
    @objc(hex_colorWithHex:)
    public class func colorWithHex(hex: String) -> UIColor? {
        
        var color:UIColor? = nil
        
        let noHash = hex.stringByReplacingOccurrencesOfString("#", withString: "")
        
{'fraction_non_alphanumeric': 0.1204954954954955, 'fraction_numerical': 0.013513513513513514, 'mean_word_length': 2.5118577075098814, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '3290995', 'n_tokens_mistral': 592, 'n_tokens_neox': 559, 'n_words': 151}