fix for 8 bit colors in remmina
Signed-off-by: Vasiliy Tolstov <v.tolstov@selfip.ru>
This commit is contained in:
parent
5ad25a5873
commit
a9b36a4d3a
4
image.go
4
image.go
@ -52,7 +52,7 @@ func (clr *Color) Write(c Conn) error {
|
||||
var err error
|
||||
order := clr.pf.order()
|
||||
pixel := clr.cmIndex
|
||||
if clr.pf.TrueColor == 1 {
|
||||
if clr.pf.TrueColor != 0 {
|
||||
pixel = uint32(clr.R) << clr.pf.RedShift
|
||||
pixel |= uint32(clr.G) << clr.pf.GreenShift
|
||||
pixel |= uint32(clr.B) << clr.pf.BlueShift
|
||||
@ -96,7 +96,7 @@ func (clr *Color) Read(c Conn) error {
|
||||
pixel = uint32(px)
|
||||
}
|
||||
|
||||
if clr.pf.TrueColor == 1 {
|
||||
if clr.pf.TrueColor != 0 {
|
||||
clr.R = uint16((pixel >> clr.pf.RedShift) & uint32(clr.pf.RedMax))
|
||||
clr.G = uint16((pixel >> clr.pf.GreenShift) & uint32(clr.pf.GreenMax))
|
||||
clr.B = uint16((pixel >> clr.pf.BlueShift) & uint32(clr.pf.BlueMax))
|
||||
|
@ -330,7 +330,7 @@ func (msg *SetPixelFormat) Write(c Conn) error {
|
||||
|
||||
pf := c.PixelFormat()
|
||||
// Invalidate the color map.
|
||||
if pf.TrueColor != 1 {
|
||||
if pf.TrueColor != 0 {
|
||||
c.SetColorMap(ColorMap{})
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user