Download the PHP package malenki/alpha-background without Composer
On this page you can find all versions of the php package malenki/alpha-background. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package alpha-background
AlphaBackground
Alpha background are difficult with IE6, IE7 and IE8… So this is one of the solutions using PHP.
My little class allows you to generate small PNG image (1px×1px) to have background with alpha transparency, for IE7 and IE8.
To use it, many options are available for you:
- use the class to include it into your source code. I provide for you
composer.json
file to make this easy - use a server script, I have written a little one for you
- use a CLI script, to generate images by other way.
If you have some scruples to use an image for IE, I provide some features into my class to generate good line of CSS hacked for this browser of stone's age, so, IE6 is in this family too.
How to install it?
Composer
For custom use, by using my class to do what you want, use composer to include it into your project. In your composer.json
file, include this:
Then, you can instanciate it by new \Malenki\AlphaBackground()
.
Taking source code
For a quick use, download the source, take CLI or server version of script, chaned it to create image like you want.
For custom use
Examples are better than long blahblah so, I start by showing you how to display at the browser the image:
You can do it in one line too:
You can use hexadecimal string too :
The hexadecimal string can be without alpha:
You can use CSS color name too:
If you want save the image, into all previous example, replace the last used method by save()
, this method take one argument, the file's name:
For server
I have written a little script to put on a server to display background image. To use it, simply use the following lines into your CSS file.
The script is simple, but it works, you can changed it to deserve your own need.
For CLI
You can create background image by using a little CLI script I have written for you.
Following lines show you how to use it.