5

Is it possible to have 2 colors (red, green) and give the percentage of fading.

Example:

black (#000000) => white (#ffffff) --- Percent: 50% => grey (#808080)

Is this maybe possible with jQuery xcolor, if yes, how?

(the xcolor.analogous example return circa the colors I want to have, but how could I set the percentage of fading?)

Poru
  • 8,254
  • 22
  • 65
  • 89

1 Answers1

2

You seem to have almost answered your own question: The xcolor plugin you point to has exactly the method you want:

$.xcolor.gradientlevel(color, color, position, size)

Your example would be:

$.xcolor.gradientlevel("#000000", "#ffffff", 50, 100)
Ned Batchelder
  • 364,293
  • 75
  • 561
  • 662