Backport Tweak emphasis behavior to make it a bit closer to hardware

This commit is contained in:
vailkyte 2023-05-18 08:04:58 -05:00 committed by GitHub
parent 0908074346
commit 1f27d115d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -627,23 +627,23 @@ public:
double redColor = (uint8_t)(paletteBuffer[i] >> 16);
double greenColor = (uint8_t)(paletteBuffer[i] >> 8);
double blueColor = (uint8_t)paletteBuffer[i];
if(j & 0x01) {
//Intensify red
redColor *= 1.1;
greenColor *= 0.9;
blueColor *= 0.9;
}
if(j & 0x02) {
//Intensify green
greenColor *= 1.1;
redColor *= 0.9;
blueColor *= 0.9;
}
if(j & 0x04) {
//Intensify blue
blueColor *= 1.1;
redColor *= 0.9;
greenColor *= 0.9;
if((i & 0x0F) <= 0x0D) {
//Emphasis doesn't affect columns $xE and $xF
if(j & 0x01) {
//Intensify red
greenColor *= 0.84;
blueColor *= 0.84;
}
if(j & 0x02) {
//Intensify green
redColor *= 0.84;
blueColor *= 0.84;
}
if(j & 0x04) {
//Intensify blue
redColor *= 0.84;
greenColor *= 0.84;
}
}
uint8_t r = (uint8_t)(redColor > 255 ? 255 : redColor);