Matt
Matt

Reputation: 22921

Automatically choose a good border color based on background color

I'm looking for any resources on choosing "good" colors based on one specified color. Specifically if I gave an input of say... #6e93a8, a nice corporate blue, it could spit out a darker blue for a border color and perhaps a white or black for text based on how dark the given color is. Keep in mind I can input any hex value.

I have a feel this is just messing around with adding and subtracting hex values, but I'm hoping someone has done this before and has found some good resources or an algorithm.

Thanks! Matt Mueller

Upvotes: 1

Views: 2938

Answers (2)

mtomis
mtomis

Reputation: 1364

If you already know what you want to do to the colors and you just need an algorithm for transforming the colors then check this answer which contains the algorithm for converting between RGB and HSV (and back). From then on you can alter the HSV values (to make the colors ligher, darker etc) or apply rules if the color is dark or light.

Upvotes: 2

Michael Mrozek
Michael Mrozek

Reputation: 175665

Are you looking for an algorithm or just a tool? Kuler is a web-based tool for designing color schemes that I think would serve your purposes

Upvotes: 0

Related Questions