setting the default color in the main screen and moving getrealcolor fct

This commit is contained in:
Clément Le Bihan
2020-05-26 01:03:04 +02:00
parent df16fc1a64
commit 81b20e559a
6 changed files with 46 additions and 30 deletions
+23
View File
@@ -0,0 +1,23 @@
//
// Created by cbihan on 5/26/20.
//
#include <stdint-gcc.h>
uint32_t getRealColor(uint16_t color)
{
uint8_t blue;
uint8_t red;
uint8_t green;
uint32_t pixelTmp;
blue = (color & 0x7D00U) >> 10U;
green = (color & 0x03E0U) >> 5U;
red = (color & 0x001FU);
pixelTmp = 0xFF;
pixelTmp += (red * 255U / 31U) << 24U;
pixelTmp += (green * 255U / 31U) << 16U;
pixelTmp += (blue * 255U / 31U) << 8U;
return pixelTmp;
}