Don't panic on unknown pixel formats

This commit is contained in:
Philipp Oppermann
2020-09-09 16:35:29 +02:00
parent 261f4d0649
commit 4f4a70bf79

View File

@@ -87,7 +87,8 @@ impl Writer {
let color = if on { let color = if on {
match self.info.pixel_format { match self.info.pixel_format {
PixelFormat::RGB => [0x33, 0xff, 0x66, 0], PixelFormat::RGB => [0x33, 0xff, 0x66, 0],
other => panic!("unknown pixel format {:?}", other), PixelFormat::BGR => [0x66, 0xff, 0x33, 0],
_other => [0xff, 0xff, 0xff, 0],
} }
} else { } else {
[0, 0, 0, 0] [0, 0, 0, 0]