Avatar
@swift-4.2.4 -O struct RGBA<Channel> { var red: Channel var green: Channel var blue: Channel var alpha: Channel } let rgbaArray = [RGBA(red: 255, green: 127, blue: 0, alpha: 255)] rgbaArray.withUnsafeBufferPointer { rgbaPointer in print(rgbaPointer[0]) rgbaPointer.withMemoryRebound(to: UInt8.self) { uint8Pointer in print(uint8Pointer[0]) } } (edited)
🛠 1