Allow a slider to set the colorRotation in radians

This commit is contained in:
Eryn Wells 2018-10-09 16:51:35 -07:00
parent e2886f9aad
commit 1b8fc1feb7
5 changed files with 74 additions and 6 deletions

View file

@ -92,6 +92,21 @@ extension UserDefaults {
}
}
public var colorRotation: Float {
get {
if let obj = object(forKey: "colorRotation") as? NSNumber {
return obj.floatValue
} else {
let defaultValue: Float = 0.0
set(defaultValue, forKey: "colorRotation")
return defaultValue
}
}
set {
set(newValue, forKey: "colorRotation")
}
}
func float4(forKey key: String) -> Float4? {
guard let values = array(forKey: key) as? [Float], values.count >= 4 else {
return nil