<commit_before>//
//  Gauge.swift
//  SWGauge
//
//  Created by <NAME> on 02/06/15.
//  Copyright (c) 2015 <NAME>. All rights reserved.
//

import UIKit
import QuartzCore

@IBDesignable
public class Gauge: UIView {

    enum GaugeType: Int {
        case Circle = 0
        case Left
        case Right
        case Top
        case Bottom
        case Custom
    }

    @IBInspectable var startColor: UIColor = UIColor.greenColor() {
        didSet {
            updateLayerProperties()
        }
    }

    /// default is nil: endColor is same as startColor
    @IBInspectable var endColor: UIColor? {
        didSet {
            updateLayerProperties()
        }
    }
    var _endColor: UIColor {
        get {
            if let endColor = endColor {
                return endColor
            } else {
                return startColor
            }
        }
        set {
            endColor = newValue
        }
    }
    @IBInspectable var bgColor: UIColor? {
        didSet {
            updateLayerProperties()
        }
    }

    var _bgStartColor: UIColor {
        set {
            bgColor = newValue
        }
        get {
            if let bgColor = bgColor {
                return bgColor.colorWithAlphaComponent(bgAlpha)
            } else {
                return startColor.colorWithAlphaComponent(bgAlpha)
            }
        }
    }

    var _bgEndColor: UIColor {
        set {
            bgColor = newValue
        }
        get {
            if let bgColor = bgColor {
                return bgColor.colorWithAlphaComponent(bgAlpha)
            } else {
                return _endColor.colorWithAlphaComponent(bgAlpha)
            }
        }
    }
    @IBInspectable var bgAlpha: CGFloat = 0.4 {
        didSet {
            updateLayerProperties()
        }
    }
    @IBInspectable var rotate: Double = 0 {
        didSet {
            updateLayerProperties()
        }
    }
    @IBInspectable var customColors: Bool = true {
        didSet {
            updateLayerProperties()
        }
    }
//    @IBInspectable var ringShadowRadius: CGFloat = 0 {
//        didSet {
//            updateLayerProperties()
//        }
//    }
//    @IBInspectable var ringShadowOpacity: Float = 0 {
//        didSet {
//            updateLayerProperties()
//        }
//    }

    @IBInspectable public var reverse: Bool = false {
        didSet {
            resetLayers()
            updateLayerProperties()<commit_msg>upcomment Code. It was a Swift compiller problem. With new version of Xcode it's fixed! Close #5.<commit_after>//
//  Gauge.swift
//  SWGauge
//
//  Created by <NAME> on 02/06/15.
//  Copyright (c) 2015 <NAME>. All rights reserved.
//

import UIKit
import QuartzCore

@IBDesignable
public class Gauge: UIView {

    enum GaugeType: Int {
        case Circle = 0
        case Left
        case Right
        case Top
        case Bottom
        case Custom
    }

    @IBInspectable var startColor: UIColor = UIColor.greenColor() {
        didSet {
            updateLayerProperties()
        }
    }

    /// default is nil: endColor is same as startColor
    @IBInspectable var endColor: UIColor? {
        didSet {
            updateLayerProperties()
        }
    }
    var _endColor: UIColor {
        get {
            if let endColor = endColor {
                return endColor
            } else {
                return startColor
            }
        }
        set {
            endColor = newValue
        }
    }
    @IBInspectable var bgColor: UIColor? {
        didSet {
            updateLayerProperties()
        }
    }

    var _bgStartColor: UIColor {
        set {
            bgColor = newValue
        }
        get {
            if let bgColor = bgColor {
                return bgColor.colorWithAlphaComponent(bgAlpha)
            } else {
                return startColor.colorWithAlphaComponent(bgAlpha)
            }
        }
    }

    var _bgEndColor: UIColor {
        set {
            bgColor = newValue
        }
        get {
            if let bgColor = bgColor {
                return bgColor.colorWithAlphaComponent(bgAlpha)
            } else {
                return _endColor.colorWithAlphaComponent(bgAlpha)
            }
        }
    }
    @IBInspectable var bgAlpha: CGFloat = 0.4 {
        didSet {
            updateLayerProperties()
        }
    }
    @IBInspectable var rotate: Double = 0 {
        didSet {
            updateLayerProperties()
        }
    }
    @IBInspectable var customColors: Bool = true {
        didSet {
            updateLayerProperties()
        }
    }
    @IBInspectable var ringShadowRadius: CGFloat = 0 {
        didSet {
            updateLayerProperties()
        }
    }
    @IBInspectable var ringShadowOpacity: Float = 0.5 {
        didSet {
            updateLayerProperties()
        }
    }

    @IBInspectable public var reverse: Bool = false {
        didSet {
            resetLayers()
            updateLayerProperties()
{'fraction_non_alphanumeric': 0.07634971796937953, 'fraction_numerical': 0.00684931506849315, 'mean_word_length': 1.3609129814550642, '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': '5731399', 'n_tokens_mistral': 1423, 'n_tokens_neox': 1372, 'n_words': 333}