Forums
View unanswered posts | View active topics It is currently Fri Sep 19, 2014 3:52 pm



Reply to topic  [ 1 post ] 
 SVG gradient script in PHP for IE9 with multiple stops 
Author Message

Joined: Tue May 03, 2011 2:46 pm
Posts: 4
Post SVG gradient script in PHP for IE9 with multiple stops
A little script in PHP I wrote to use gradient in IE9 with multiple stops.
File attached (compressed in RAR format)

Instructions below and also commented inside PHP file.

Hope it helps anyone...

============================================
SVG gradient script in PHP by bccsergio

USAGE:
you can pass the following vars to gradient.php via GET:

x1, x2, y1, y2 (Ex.: x1=0&x2=0&y1=0&y2=100) - This values are OPTIONAL, but if set, MUST be a valid number between 0 and 100. They will change gradient direction.

stop1, stop2, ..., stop5, .. stopN (where N is the last stop - you can use as many stops as you want)
stop vars must have 2 arguments, separated by a comma (,) (Ex.: stop1=0,BCD1E0&stop2=49,7DA7C3&stop3=50,4E87AD&stop4=100,4E87AD)
first argument is the stop place (%) - This values MUST be a valid number between 0 and 100 WITHOUT the '%' char
second argument is the stop color (#) - This value MUST be a valid HEX color WITHOUT the '#' char
PS.: AT LEAST 2 STOP VALUES ARE NEEDED TO GENERATE A VALID GRADIENTE

Full examples in a CSS file:
.my_span { background: url(gradient.php?x1=0&x2=0&y1=0&y2=100&stop1=0,BCD1E0&stop2=49,7DA7C3&stop3=50,4E87AD&stop4=100,4E87AD); }
#my_div { background: url(gradient.php?x1=100&stop1=0,BCD1E0&stop2=49,7DA7C3&stop3=50,4E87AD&stop4=100,4E87AD); }
.my_span { background: url(gradient.php?x2=100&y2=0&stop1=0,BCD1E0&stop2=50,4E87AD&stop3=100,4E87AD); }
#my_div { background: url(gradient.php?stop1=0,BCD1E0&stop2=100,4E87AD); }

If no vars are passed via GET to gradient.php, default values will be:
x1=0
x2=0
y1=0
y2=100
stop1=0,FFFFFF
stop2=100,000000

PS.: Any error in vars will set them to default values.
============================================


Attachments:
File comment: SVG gradient script in PHP for IE9 with multiple stops by bccsergio
gradient.rar [1.49 KiB]
Downloaded 325 times
Thu May 05, 2011 11:23 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.