class Bitmap
def draw_bar_ryex(x, y, w, h, p, c)
gray = Color.new(100, 100, 100)
# border
fill_rect(x, y, w, h, Color.new(0, 0, 0))
# horizontal gradients:
# where no coloured bar is shown.
for i in 0..w - 3
gr = gray.red * i / w
gg = gray.green * i / w
gb = gray.blue * i / w
#fill_rect(x+1+i,y+1,1,h-2,Color.new(gr, gg, gb)) #normal
fill_rect(x+w-1-i,y+1,1,h-2,Color.new(gr, gg, gb)) #reverse
end
# coloured bar.
for i in 0..(p * (w - 3))
r = c.red * i / w
g = c.green * i / w
b = c.blue * i / w
fill_rect(x+1+i,y+1,1,h-2,Color.new(r, g, b))
end
end
end
replace line 144-175 with this code.
i made the gray gradient (bar background) go from light to dark because at a certain value the gray background and coloured foreground of the bar become indistinguishable, but you can change it back if you want by putting the # from the #normal line to the #reverse line.