<commit_before>//
//  UIColor.swift
//  MHAppKit
//
//  Created by <NAME> on 3/3/16.
//  Copyright © 2016 <NAME>. All rights reserved.
//

import Foundation
import UIKit

extension UIColor {
    
    ///The maximum RGB value - 24bit unsinged integer
    private static let RGBMaxValue: UInt32 = 16777215
    
    /**
     
     Creates an instance of the receiver with 8bit RGB component values and alpha.
     
     - parameter R: The red component value from 0 to 255
     - parameter G: The green component value from 0 to 255
     - parameter B: The blue component value from 0 to 255
     - parameter alpha: The alpha component value from 0 to 1. Default to 1
     
     */
    
    public convenience init(R: UInt8, G: UInt8, B: UInt8, alpha: CGFloat = 1) {
        
        self.init(red: CGFloat(R)/CGFloat(UInt8.max), green: CGFloat(G)/CGFloat(UInt8.max), blue: CGFloat(B)/CGFloat(UInt8.max), alpha: alpha)
    }
    
    /**
     
     Creates an instance of the receiver with 24bit RGB value and alpha<commit_msg>- UIColor - improved reading and debugging<commit_after>//
//  UIColor.swift
//  MHAppKit
//
//  Created by <NAME> on 3/3/16.
//  Copyright © 2016 <NAME>. All rights reserved.
//

import Foundation
import UIKit

extension UIColor {
    
    ///The maximum RGB value - 24bit unsinged integer
    private static let RGBMaxValue: UInt32 = 16777215
    
    /**
     
     Creates an instance of the receiver with 8bit RGB component values and alpha.
     
     - parameter R: The red component value from 0 to 255
     - parameter G: The green component value from 0 to 255
     - parameter B: The blue component value from 0 to 255
     - parameter alpha: The alpha component value from 0 to 1. Default to 1
     
     */
    
    public convenience init(R: UInt8, G: UInt8, B: UInt8, alpha: CGFloat = 1) {
        
        let red = CGFloat(R)/CGFloat(UInt8.max)
        let green = CGFloat(G)/CGFloat(UInt8.max)
        let blue = CGFloat(B)/CGFloat(UInt8.max)
        
        self.init(red: red, green: green, blue: blue, alpha: alpha)
    }
    
    /**
     
     Creates an instance of the receiver with 24bit RGB value and alpha
{'fraction_non_alphanumeric': 0.08850787766450417, 'fraction_numerical': 0.04170528266913809, 'mean_word_length': 2.2515060240963853, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '5887782', 'n_tokens_mistral': 734, 'n_tokens_neox': 666, 'n_words': 255}