mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-05-13 16:37:27 +00:00
Faster conversion of plaette to NRGB for opaque colors
This commit is contained in:
parent
2dea3087b3
commit
9212c08638
1 changed files with 2 additions and 0 deletions
|
|
@ -177,6 +177,8 @@ func newScannerRGB(img image.Image, opaque_base NRGBColor) *scanner_rgb {
|
|||
switch a {
|
||||
case 0:
|
||||
s.palette[i] = opaque_base
|
||||
case 0xffff:
|
||||
s.palette[i] = NRGBColor{uint8(r >> 8), uint8(g >> 8), uint8(b >> 8)}
|
||||
default:
|
||||
blend(ds, s.opaque_base, uint8((r*0xffff/a)>>8), uint8((g*0xffff/a)>>8), uint8((b*0xffff/a)>>8), uint8(a>>8))
|
||||
s.palette[i] = NRGBColor{d[0], d[1], d[2]}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue