Allow a slider to set the colorRotation in radians
This commit is contained in:
parent
e2886f9aad
commit
1b8fc1feb7
5 changed files with 74 additions and 6 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue