Skip to content

Commit 3128147

Browse files
committed
fix colors
1 parent 8f4a159 commit 3128147

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

swiftui-previews/swiftui-previews/ContentView.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ final class MockVideoSource {
9999

100100
// Cycle hue over ~5 seconds (at 30fps = 150 frames per cycle)
101101
let hue = CGFloat(frameCount % 150) / 150.0
102-
let color = PlatformColor(hue: hue, saturation: 1.0, brightness: 0.8, alpha: 1.0)
102+
let color = PlatformColor(hue: hue, saturation: 1.0, brightness: 1.0, alpha: 1.0)
103103

104104
guard let buffer = Self.makePixelBuffer(color: color, frameCount: frameCount, fps: currentFps, size: bufferSize)
105105
else { return }
@@ -139,7 +139,9 @@ final class MockVideoSource {
139139
bitsPerComponent: 8,
140140
bytesPerRow: CVPixelBufferGetBytesPerRow(buffer),
141141
space: CGColorSpaceCreateDeviceRGB(),
142-
bitmapInfo: CGImageAlphaInfo.premultipliedFirst.rawValue
142+
bitmapInfo: CGBitmapInfo.byteOrder32Little.union(
143+
CGBitmapInfo(rawValue: CGImageAlphaInfo.premultipliedFirst.rawValue)
144+
).rawValue
143145
)
144146
else { return nil }
145147

0 commit comments

Comments
 (0)