17 lines
366 B
Swift
17 lines
366 B
Swift
import SwiftUI
|
|
|
|
extension Color {
|
|
|
|
init(_ r: Int, _ g: Int, _ b: Int) {
|
|
self.init(Double(r) / 255, Double(g) / 255, Double(b) / 255)
|
|
}
|
|
|
|
init(r: Int, g: Int, b: Int) {
|
|
self.init(Double(r) / 255, Double(g) / 255, Double(b) / 255)
|
|
}
|
|
|
|
init(_ r: Double, _ g: Double, _ b: Double) {
|
|
self.init(red: r, green: g, blue: b)
|
|
}
|
|
}
|