javascript - How to Find matching color? -


i have button image: enter image description here

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

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -