ref: 507ddf3a5cb60f52a8bc2b8e013fd333d75208a4
dir: /libdraw-pastelmenucol/
--- a//sys/src/libdraw/emenuhit.c +++ b//sys/src/libdraw/emenuhit.c @@ -27,13 +27,14 @@ menucolors(void) { /* Main tone is greenish, with negative selection */ - back = allocimagemix(display, DPalegreen, DWhite); - high = allocimage(display, Rect(0,0,1,1), CMAP8, 1, DDarkgreen); /* dark green */ - bord = allocimage(display, Rect(0,0,1,1), CMAP8, 1, DMedgreen); /* not as dark green */ - if(back==nil || high==nil || bord==nil) + text = display->white; + high = allocimage(display, Rect(0,0,1,1), CMAP8, 1, 0x9C9C9CFF); + bord = allocimage(display, Rect(0,0,1,1), CMAP8, 1, 0xDEDEDEFF); + if(text==nil || high==nil || bord==nil) goto Error; - text = display->black; + back = display->black; htext = back; + menutxt = high; return; Error: @@ -149,10 +150,7 @@ if(r.max.y < r.min.y+2) r.max.y = r.min.y+2; border(screen, r, 1, bord, ZP); - if(menutxt == 0) - menutxt = allocimage(display, Rect(0, 0, 1, 1), CMAP8, 1, DDarkgreen); - if(menutxt) - draw(screen, insetrect(r, 1), menutxt, nil, ZP); + draw(screen, insetrect(r, 1), menutxt, nil, ZP); } int --- a//sys/src/libdraw/menuhit.c +++ b//sys/src/libdraw/menuhit.c @@ -28,13 +28,14 @@ menucolors(void) { /* Main tone is greenish, with negative selection */ - back = allocimagemix(display, DPalegreen, DWhite); - high = allocimage(display, Rect(0,0,1,1), screen->chan, 1, DDarkgreen); /* dark green */ - bord = allocimage(display, Rect(0,0,1,1), screen->chan, 1, DMedgreen); /* not as dark green */ - if(back==nil || high==nil || bord==nil) + text = display->white; + high = allocimage(display, Rect(0,0,1,1), CMAP8, 1, 0x9C9C9CFF); + bord = allocimage(display, Rect(0,0,1,1), CMAP8, 1, 0xDEDEDEFF); + if(text==nil || high==nil || bord==nil) goto Error; - text = display->black; + back = display->black; htext = back; + menutxt = high; return; Error: @@ -146,10 +147,7 @@ if(r.max.y < r.min.y+2) r.max.y = r.min.y+2; border(m, r, 1, bord, ZP); - if(menutxt == 0) - menutxt = allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, DDarkgreen); /* border color; BUG? */ - if(menutxt) - draw(m, insetrect(r, 1), menutxt, nil, ZP); + draw(m, insetrect(r, 1), menutxt, nil, ZP); } int