I remembered Ken had some real nice looking buttons for his calculator, back when he posted it here:
https://www.qb64.org/forum/index.php?topic=2867.msg121306#msg121306In the spirit of all great coders, I studied his code a bit, and then used it as a reference to help me come up with this little snippet:
'Gray buttons
Button 50, 100, 50, 50, 50, 50, 50, 10, 10, 10, "FOO" 'up
Button 100, 100, 50, 50, 150, 150, 150, -5, -5, -5, "FOO" 'down
Button 150, 100, 50, 50, 50, 50, 50, 10, 10, 10, "FOO" 'up
'Lavander buttons
Button 250, 100, 50, 50, 50, 50, 50, 10, 10, 20, "FOO" 'up
Button 300, 100, 50, 50, 150, 150, 250, -5, -5, -10, "FOO" 'down
Button 350, 100, 50, 50, 50, 50, 50, 10, 10, 20, "FOO" 'up
SUB Button
(x
, y
, wide
, tall
, r
, g
, b
, rc
, gc
, bc
, caption$
) rm = rm + rc
gm = gm + gc
bm = bm + bc
k
= _RGB32(r
+ rm
, g
+ gm
, b
+ bm
) LINE (x
+ i
, y
+ i
)-(x
+ wide
- i
, y
+ tall
- i
), k
, B
From my experience playing with the numbers here, you want to pick the base color shade that you want to end up with as a central color for start, and then modify the values from to get to that point.
For example, let's say I want to end up with a Red 100 Green 200 Blue 100 button...
For the up button, you start with small values (say 50, 100, 50), and then increase them so they reach your goal after 10 iterations, which would be 5, 10, 5. In the end, you end up with the last 6 parameters being (50, 100, 50, 5, 10, 5).
For the down button, you basically just work in reverse, with half the values as your up buttons. Your decrease would be -2.5, -5, -2.5, so after 10 passes, you'd go 25, 50, 25 from your base, so you'd end up with (125, 250, 125, -2.5, -5, -2.5).
Not the perfect shade you were dreaming of? Just tweak the values some until you can make it closer to what you're looking for.