Skip to content

Commit f588218

Browse files
committed
Quick fix for 4d04102 (Optimised SimpleColor)
Despite it "looking right" and a quick test in the REPL, it turns out I put the _ in the wrong spot when rewriting the NTuple-based modification to Kristoffer's commit. Ooops. Anyway, that's fixed now, and it occurs to me that for correctness we may as well call "htol" because we assume the byte order is little-endian when using the results of reinterpret (even though it will almost always be a no-op).
1 parent 4d04102 commit f588218

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/faces.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ end
2727
SimpleColor(r::Integer, g::Integer, b::Integer) = SimpleColor((; r=UInt8(r), g=UInt8(g), b=UInt8(b)))
2828

2929
function SimpleColor(rgb::UInt32)
30-
_, g, b, r = reinterpret(NTuple{4, UInt8}, rgb)
30+
b, g, r, _ = reinterpret(NTuple{4, UInt8}, htol(rgb))
3131
SimpleColor(r, g, b)
3232
end
3333

0 commit comments

Comments
 (0)