javascript - How to Find matching color? -
i have button image:
it 2 colors
i want give users option change color of button. can choose color want, 1 color. need determinate matching color.
for example, if want button, in blue (#00f), how make button looks similar in blue?
the question rather unclear (and you're using wrong values, button 1s hovering color brighter it's normal color). if want darker version of color, it's pretty simple:
int rgb //make color darker double factor = 0.9 int red = red(rgb) * factor int green = green(rgb) * factor int blue = blue(rgb) * factor int darker = rgb(red , blue , green)
just change factor < 1
> 1
if want color brighter instead of darker.
black #000000, every color becomes darker, if reduce it's rgb-values.
Comments
Post a Comment