RGB should not be packed, so that it has align = 1

This commit is contained in:
Mitchell Hashimoto
2022-09-23 13:10:51 -07:00
parent a1d238e385
commit 1a2b684b0e
2 changed files with 3 additions and 5 deletions

View File

@@ -94,12 +94,13 @@ pub const Name = enum(u8) {
};
/// RGB
pub const RGB = packed struct {
pub const RGB = struct {
r: u8 = 0,
g: u8 = 0,
b: u8 = 0,
test {
test "size" {
try std.testing.expectEqual(@as(usize, 24), @bitSizeOf(RGB));
try std.testing.expectEqual(@as(usize, 3), @sizeOf(RGB));
}
};