Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/44375 )
Change subject: libpayload: cbgfx: Add color mapping functionality ......................................................................
Patch Set 1:
(2 comments)
Neat! Does it work (i.e. look right)?
https://review.coreboot.org/c/coreboot/+/44375/1/payloads/libpayload/drivers... File payloads/libpayload/drivers/video/graphics.c:
https://review.coreboot.org/c/coreboot/+/44375/1/payloads/libpayload/drivers... PS1, Line 221: (UINT8_MAX - color) It took me embarrasingly long to figure out what you're doing here and why what I wrote in the bug was wrong. ^^ (I think the other option would have been `bg_color + ((fg_color - bg_color) * color / UINT8_MAX)`, but the two should be equivalent. Maybe one operation less, though?)
https://review.coreboot.org/c/coreboot/+/44375/1/payloads/libpayload/drivers... PS1, Line 222: int16_t This should be unnecessary (automatic integer promotion to `int`). If you want it for clarity, the correct type should be uint16_t (255 * 255 might exceed int16_t).