use floats for instance colour memory

This commit is contained in:
2024-08-19 07:59:36 +10:00
parent f203bcc7c1
commit 8904db24a5
4 changed files with 7 additions and 3 deletions

View File

@ -89,6 +89,10 @@ public extension Color where T: BinaryFloatingPoint {
self.init(r: newR, g: newG, b: newB, a: Self.one)
}
init<U: BinaryFloatingPoint>(_ other: Color<U>) {
self._values = SIMD4<T>(other._values)
}
init<U: BinaryInteger>(_ other: Color<U>) {
let mul = 1 / T(0xFF)
self.init(