From 4722a069233b35efd0b600c973e7a7e9bca01d16 Mon Sep 17 00:00:00 2001 From: hhvn Date: Sun, 19 Nov 2023 13:49:28 +0000 Subject: Do int2rgb conversions once. In config.go. --- drw/x.go | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) (limited to 'drw/x.go') diff --git a/drw/x.go b/drw/x.go index c004d78..094b705 100644 --- a/drw/x.go +++ b/drw/x.go @@ -3,7 +3,6 @@ package drw // import "hhvn.uk/hbspbar/drw" import ( "os" "image" - "image/color" "hhvn.uk/hbspbar/config" "hhvn.uk/hbspbar/common" @@ -69,32 +68,6 @@ func init() { }}() } -func int2rgb(argb uint32) (color.RGBA) { - return color.RGBA{ - B: uint8( argb & 0x000000ff), - G: uint8((argb & 0x0000ff00) >> 8), - R: uint8((argb & 0x00ff0000) >> 16), - A: uint8((argb & 0xff000000) >> 24) } -} - -func rgb2int(c color.Color) uint32 { - r, g, b, a := c.RGBA() - - r /= 256 - g /= 256 - b /= 256 - a /= 256 - - var ret uint32 = 0 - - ret |= (a << 24) - ret |= (r << 16) - ret |= (g << 8) - ret |= b - - return ret -} - type Window struct { id xproto.Window } @@ -112,7 +85,7 @@ func WindowCreate(x, y, w, h uint) (*Window, error) { int16(x), int16(y), uint16(w), uint16(h), 0, xproto.WindowClassInputOutput, screen.RootVisual, xproto.CwBackPixel|xproto.CwEventMask, []uint32{ - config.Bg, + 0x00000000, xproto.EventMaskStructureNotify }) class := icccm.WmClass{"hbspbar", "hbspbar"} -- cgit v1.2.3