jquery color generator
- Started
- Last post
- 8 Responses
- ukit
Would it be possible to write jQuery that, given a certain hex color, returns back variations on it, like for instance a slightly lighter or darker color with the same hue? Does something like this exist already?
- ukit0
Like, I specify #00507f (H 202, S 100, B 50), and it returns #0079bf (H 202, S 100, B 75). Just wondering if it's possible to compute that in JQuery.
- heavyt0
i think you need to figure out the algorithm, then JS can do that math for you.
- SteveJobs0
depends. if you just want to lighten or darken, or change the brightness you can mask out the individual rgb components, modify those channels, then convert back to hex. pretty simple. could be done in js easily.
- SteveJobs0
also, there are tons of hsl/hsb<->rgb functions published online. many of them already converted to js/as3/c/java/etc so you can manipulate the hue, saturation or lightness/brightness easily through those properties using a scalar or whatever.
- BattleAxe0
this site does exactly that
- ukit0
Awesome
- zr0
This does exactly what you describe, using prototype though:
http://0to255.com/