//
//  LFOPickerStyleKit.swift
//  AKSynthOne
//
//  Created by Matthew Fecher on 1/9/19.
//  Copyright © 2019 AudioKit. All rights reserved.
//
//  Generated by PaintCode
//  http://www.paintcodeapp.com
//



import UIKit

public class LFOPickerStyleKit : NSObject {

    //// Drawing Methods

    @objc dynamic public class func drawLFOWaveformPicker(frame: CGRect = CGRect(x: 0, y: 0, width: 215, height: 42), fraction: CGFloat = 0) {
        //// Color Declarations
        var color = UIColor(red: 0.133, green: 0.133, blue: 0.133, alpha: 1.000)
        let selected = UIColor(red: 0.902, green: 0.533, blue: 0.008, alpha: 1.000)
        let unselected = UIColor(red: 0.533, green: 0.533, blue: 0.533, alpha: 1.000)

        //// Variable Declarations
        let color1 = fraction <= 0.3 ? selected : unselected
        let color2 = fraction > 0.3 && fraction <= 0.6 ? selected : unselected
        let color3 = fraction > 0.6 && fraction <= 0.85 ? selected : unselected
        let color4 = fraction > 0.85 && fraction <= 1 ? selected : unselected

        //// background Drawing
        let backgroundPath = UIBezierPath(rect: CGRect(x: frame.minX, y: frame.minY, width: 215, height: 42))
       
        color = #colorLiteral(red: 0.1254734099, green: 0.1255019307, blue: 0.1254696548, alpha: 0) // set color to clear
        color.setFill()
        backgroundPath.fill()


        //// DownSaw Drawing
        let downSawPath = UIBezierPath()
        downSawPath.move(to: CGPoint(x: frame.minX + 0.80000 * frame.width, y: frame.minY + 0.73810 * frame.height))
        downSawPath.addLine(to: CGPoint(x: frame.minX + 0.80000 * frame.width, y: frame.minY + 0.35714 * frame.height))
        downSawPath.addLine(to: CGPoint(x: frame.minX + 0.86047 * frame.width, y: frame.minY + 0.73810 * frame.height))
        color4.setStroke()
        downSawPath.lineWidth = 2
        downSawPath.stroke()


        //// UpSaw Drawing
        let upSawPath = UIBezierPath()
        upSawPath.move(to: CGPoint(x: frame.minX + 0.62791 * frame.width, y: frame.minY + 0.73810 * frame.height))
        upSawPath.addLine(to: CGPoint(x: frame.minX + 0.62791 * frame.width, y: frame.minY + 0.35714 * frame.height))
        upSawPath.addLine(to: CGPoint(x: frame.minX + 0.56744 * frame.width, y: frame.minY + 0.73810 * frame.height))
        color3.setStroke()
        upSawPath.lineWidth = 2
        upSawPath.stroke()


        //// Square Drawing
        let squarePath = UIBezierPath()
        squarePath.move(to: CGPoint(x: frame.minX + 0.30961 * frame.width, y: frame.minY + 0.52381 * frame.height))
        squarePath.addLine(to: CGPoint(x: frame.minX + 0.30961 * frame.width, y: frame.minY + 0.33333 * frame.height))
        squarePath.addLine(to: CGPoint(x: frame.minX + 0.35208 * frame.width, y: frame.minY + 0.33333 * frame.height))
        squarePath.addLine(to: CGPoint(x: frame.minX + 0.35208 * frame.width, y: frame.minY + 0.71429 * frame.height))
        squarePath.addLine(to: CGPoint(x: frame.minX + 0.39455 * frame.width, y: frame.minY + 0.71429 * frame.height))
        squarePath.addLine(to: CGPoint(x: frame.minX + 0.39455 * frame.width, y: frame.minY + 0.33333 * frame.height))
        squarePath.addLine(to: CGPoint(x: frame.minX + 0.43702 * frame.width, y: frame.minY + 0.33333 * frame.height))
        squarePath.addLine(to: CGPoint(x: frame.minX + 0.43702 * frame.width, y: frame.minY + 0.52381 * frame.height))
        color2.setStroke()
        squarePath.lineWidth = 2
        squarePath.stroke()


        //// SineWave Drawing
        let sineWavePath = UIBezierPath()
        sineWavePath.move(to: CGPoint(x: frame.minX + 0.06047 * frame.width, y: frame.minY + 0.49841 * frame.height))
        sineWavePath.addCurve(to: CGPoint(x: frame.minX + 0.08372 * frame.width, y: frame.minY + 0.30952 * frame.height), controlPoint1: CGPoint(x: frame.minX + 0.06047 * frame.width, y: frame.minY + 0.49841 * frame.height), controlPoint2: CGPoint(x: frame.minX + 0.05581 * frame.width, y: frame.minY + 0.30952 * frame.height))
        sineWavePath.addCurve(to: CGPoint(x: frame.minX + 0.12093 * frame.width, y: frame.minY + 0.71429 * frame.height), controlPoint1: CGPoint(x: frame.minX + 0.11163 * frame.width, y: frame.minY + 0.30952 * frame.height), controlPoint2: CGPoint(x: frame.minX + 0.08372 * frame.width, y: frame.minY + 0.71429 * frame.height))
        sineWavePath.move(to: CGPoint(x: frame.minX + 0.18140 * frame.width, y: frame.minY + 0.49841 * frame.height))
        sineWavePath.addCurve(to: CGPoint(x: frame.minX + 0.15814 * frame.width, y: frame.minY + 0.30952 * frame.height), controlPoint1: CGPoint(x: frame.minX + 0.18140 * frame.width, y: frame.minY + 0.49841 * frame.height), controlPoint2: CGPoint(x: frame.minX + 0.18605 * frame.width, y: frame.minY + 0.30952 * frame.height))
        sineWavePath.addCurve(to: CGPoint(x: frame.minX + 0.12093 * frame.width, y: frame.minY + 0.71429 * frame.height), controlPoint1: CGPoint(x: frame.minX + 0.13023 * frame.width, y: frame.minY + 0.30952 * frame.height), controlPoint2: CGPoint(x: frame.minX + 0.15814 * frame.width, y: frame.minY + 0.71429 * frame.height))
        color1.setStroke()
        sineWavePath.lineWidth = 2
        sineWavePath.stroke()
    }

}
