From 6e2d06836925bffde76fd1ff447c9f61cd3cadd2 Mon Sep 17 00:00:00 2001 From: Andy Liu Date: Sat, 30 Nov 2024 18:23:12 +0700 Subject: [PATCH] Fix error in FallingSand project Signed-off-by: Andy Liu --- .../13MoreProjects/FallingSand/Sources/Sand.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Examples/SwiftIOPlayground/13MoreProjects/FallingSand/Sources/Sand.swift b/Examples/SwiftIOPlayground/13MoreProjects/FallingSand/Sources/Sand.swift index 626310e..bef4389 100644 --- a/Examples/SwiftIOPlayground/13MoreProjects/FallingSand/Sources/Sand.swift +++ b/Examples/SwiftIOPlayground/13MoreProjects/FallingSand/Sources/Sand.swift @@ -162,7 +162,7 @@ struct Colors { // The screen needs RGB565 color data, so change color data from UInt32 to UInt16. // Besides, the board uses little endian format, so the bytes are swapped. static func getRGB565BE(_ color: UInt32) -> UInt16 { - return UInt16(((color & 0xF80000) >> 8) | ((color & 0xFC00) >> 5) | ((color & 0xF8) >> 3)).byteSwapped + return (UInt16((color & 0xF80000) >> 8) | UInt16((color & 0xFC00) >> 5) | UInt16((color & 0xF8) >> 3)).byteSwapped } }