-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|430|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
SoCoder -> Snippet Home -> Graphical Effects


 
JL235
Created : 26 July 2009
Edited : 26 July 2009
System : Windows
Language : Blitz

Gradients

Generic gradients ready to use

About

Here is a library I just wrote over the last hour that draws gradients with variable colour at variable sizes. It means you can simply do: gradientFillX RED, GREEN, START_X, START_Y, END_X, END_Y, to have a red to green gradient that spans from (startX, startY) to (endX, endY).

This is meant as friendly advice, but I wrote this in response to problems I saw with HotShots Gradient code snippet. Rather then bitching in the comments section I thought instead I would lead by example.
  • Built as a library (ready to use)
  • Fully documented.
  • Uses common conventions for style.

Feel free to pull it apart, port to any language or build on it. Enjoy!

Gradients library



Example Usage


 

Comments


Sunday, 26 July 2009, 13:16
Phoenix
Looks like some very clean and solid code there -- good work! I would like to see more snippets be more meaty ones, like this one.