User:Makthorpe/Gradient

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

General: Displays a table with a color gradient. see talk for example usage

Operands:

  • 'width' = width of the cells
  • 'height' = height of the cells
  • 'steps'= number of cells needed Maximum 14.
  • 'red-start' = color component of first cell
  • 'green-start' = color component of first cell
  • 'blue-start' = color component of first cell
  • 'red-step' = amount to change the value of the red component from one cell to the next
    • 'blue-step' = same idea for blue
    • 'green-step' = same idea for green


Example usage:

{{:User:Makthorpe/Gradient
   |width=40
   |height=20px
   |steps=8
   |red-start=255
   |red-step=-14
   |green-start=0
   |green-step=0
   |blue-start=0
   |blue-step=18
}}

Note- the prior code does not generate the gradient below. See talk page for examples corresponding to code.