From 4f4a70bf7961b5d8ed22acc1f8e09128824eddc6 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Wed, 9 Sep 2020 16:35:29 +0200 Subject: [PATCH] Don't panic on unknown pixel formats --- src/framebuffer.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/framebuffer.rs b/src/framebuffer.rs index 84200c01..3d0053b0 100644 --- a/src/framebuffer.rs +++ b/src/framebuffer.rs @@ -87,7 +87,8 @@ impl Writer { let color = if on { match self.info.pixel_format { PixelFormat::RGB => [0x33, 0xff, 0x66, 0], - other => panic!("unknown pixel format {:?}", other), + PixelFormat::BGR => [0x66, 0xff, 0x33, 0], + _other => [0xff, 0xff, 0xff, 0], } } else { [0, 0, 0, 0]