tweak dropdown colors

This commit is contained in:
jill 2021-09-18 13:14:32 +03:00
parent 572ff2fe9b
commit 0cf2ec445a

View file

@ -167,7 +167,7 @@ function self.render()
for i,v in ipairs(dropdowns) do for i,v in ipairs(dropdowns) do
local x, y, w, h = v.x, v.y, v.width, fontHeight + margin local x, y, w, h = v.x, v.y, v.width, fontHeight + margin
love.graphics.setColor(0.06, 0.06, 0.12, 0.3) love.graphics.setColor(0.06, 0.06, 0.12, 0.6)
if love.mouse.getX() > x and love.mouse.getX() < x + w and love.mouse.getY() > y and love.mouse.getY() < y + h then if love.mouse.getX() > x and love.mouse.getX() < x + w and love.mouse.getY() > y and love.mouse.getY() < y + h then
love.graphics.setColor(0.8, 0.8, 1, love.mouse.isDown(1) and 0.4 or 0.3) love.graphics.setColor(0.8, 0.8, 1, love.mouse.isDown(1) and 0.4 or 0.3)
end end
@ -193,9 +193,9 @@ function self.render()
-- help -- help
local a = (1 - math.min(math.max((1 - (maxDropdown - gi)) * (1 - (math.abs(dropdownScrollE) / (#v.options - maxDropdown + 1))), 0), 1)) * math.max(math.min(gi - 1, 1), 0) * v.open local a = (1 - math.min(math.max((1 - (maxDropdown - gi)) * (1 - (math.abs(dropdownScrollE) / (#v.options - maxDropdown + 1))), 0), 1)) * math.max(math.min(gi - 1, 1), 0) * v.open
love.graphics.setColor(0.06, 0.06, 0.12, 0.3 * a) love.graphics.setColor(0.06, 0.06, 0.12, 0.6 * a)
if mx > x and mx < x + w and my > y and my < y + h then if mx > x and mx < x + w and my > y and my < y + h then
love.graphics.setColor(0.8, 0.8, 1, (love.mouse.isDown(1) and 0.4 or 0.3) * a) love.graphics.setColor(0.4, 0.4, 1, (love.mouse.isDown(1) and 0.8 or 0.7) * a)
end end
love.graphics.rectangle('fill', x, y, w, h) love.graphics.rectangle('fill', x, y, w, h)
@ -204,7 +204,7 @@ function self.render()
love.graphics.setColor(1, 1, 1, 1 * a) love.graphics.setColor(1, 1, 1, 1 * a)
if i == v.selected then if i == v.selected then
love.graphics.setColor(0.8, 0.8, 1, 1 * a) love.graphics.setColor(0.5, 0.5, 1, 1 * a)
end end
if v.icons and v.icons[i] then if v.icons and v.icons[i] then