PHPackages                             malenki/alpha-background - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. malenki/alpha-background

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

malenki/alpha-background
========================

1.0(12y ago)017MITPHPPHP &gt;=5.3.0

Since Nov 1Pushed 12y ago1 watchersCompare

[ Source](https://github.com/malenkiki/alpha-background)[ Packagist](https://packagist.org/packages/malenki/alpha-background)[ RSS](/packages/malenki-alpha-background/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (2)Used By (0)

AlphaBackground
===============

[](#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?
------------------

[](#how-to-install-it)

### Composer

[](#composer)

For custom use, by using my class to do what you want, use [composer](http://getcomposer.org/) to include it into your project. In your `composer.json` file, include this:

```
"require": {
       "malenki/alpha-background": "*"
   }

```

Then, you can instanciate it by `new \Malenki\AlphaBackground()`.

### Taking source code

[](#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
--------------

[](#for-custom-use)

Examples are better than long blahblah so, I start by showing you how to display at the browser the image:

```
$rgba = new AlphaBackground();
$rgba->red(255);
$rgba->green(150);
$rgba->blue(42);
$rgba->alpha(0.8);
$rgba->display();
```

You can do it in one line too:

```
$rgba = new AlphaBackground();
$rgba->red(255)->green(150)->blue(42)->alpha(0.8)->display();
```

You can use hexadecimal string too :

```
$rgba = new AlphaBackground();
$rgba->hex('#ff962acc')->display();
```

The hexadecimal string can be without alpha:

```
$rgba = new AlphaBackground();
$rgba->hex('#ff962a')->alpha(0.8)->display();
```

You can use CSS color name too:

```
$rgba = new AlphaBackground();
$rgba->name('orange')->alpha(0.7)->display();
```

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:

```
$rgba = new AlphaBackground();
$rgba->name('orange')->alpha(0.7)->save('some_file.png');
```

For server
----------

[](#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.

```
background-image: url("/rgba-server.php?color=255,150,42,0.8");
background-image: url("/rgba-server.php?color=red,0.5");
```

The script is simple, but it works, you can changed it to deserve your own need.

For CLI
-------

[](#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.

```
./rgba-cli -r 255 -g 150 -b 42 -a 0.8 -o image.png
./rgba-cli -n red -a 0.5 -o image.png
./rgba-cli --red 255 --green 150 --blue 42 --alpha 0.8 --output image.png
./rgba-cli --name red --alpha 0.5 --output image.png
./rgba-cli --hex ff962a --alpha 0.8 --output image.png
./rgba-cli --hex ff962acc --output image.png
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

4573d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6af62130bd16d4e6bbaa5877829b6377386ef9fb6593592052dbb6eeb87c4a02?d=identicon)[malenki](/maintainers/malenki)

---

Top Contributors

[![malenkiki](https://avatars.githubusercontent.com/u/195776?v=4)](https://github.com/malenkiki "malenkiki (20 commits)")

### Embed Badge

![Health badge](/badges/malenki-alpha-background/health.svg)

```
[![Health](https://phpackages.com/badges/malenki-alpha-background/health.svg)](https://phpackages.com/packages/malenki-alpha-background)
```

###  Alternatives

[wwwision/dcb-eventstore

Implementation of the Dynamic Consistency Boundary pattern described by Sara Pellegrini

2131.5k10](/packages/wwwision-dcb-eventstore)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
