andrewgjohnson/imagegradientrectangle

imagegradientrectangle is a function that will draw a gradient filled rectangle on your PHP GD images

v1.0.2 2022-11-23 00:20 UTC

This package is auto-updated.

Last update: 2024-03-31 13:02:55 UTC


README

MIT License Current Release GitHub Stars Contributors Packagist Downloads Issues Patreon

Description

imagegradientrectangle is a function that will draw a gradient filled rectangle on your PHP GD images.

Patreon - Become a Patron

imagegradientrectangle is an agjgd.org project.

Usage

With Composer

This project offers support for the Composer dependency manager. You can find the imagegradientrectangle package online on packagist.org.

Install using Composer

Either run this command:

composer require andrewgjohnson/imagegradientrectangle

or add this to the require section of your composer.json file:

"andrewgjohnson/imagegradientrectangle": "1.*"

Without Composer

To use without Composer add an include to the imagegradientrectangle.php source file.

include_once 'source/imagegradientrectangle.php';

Examples

// standard method to draw a red filled rectangle
$red = imagecolorallocate($im, 0xFF, 0x00, 0x00);
imagefilledrectangle($im, 10, 10, 100, 100, $red);

// standard method to draw a blue filled rectangle
$blue = imagecolorallocate($im, 0x00, 0x00, 0xFF);
imagefilledrectangle($im, 10, 10, 100, 100, $blue);

// this will draw a red-to-blue gradient filled rectangle
$red = imagecolorallocate($im, 0xFF, 0x00, 0x00);
$blue = imagecolorallocate($im, 0x00, 0x00, 0xFF);
imagegradientrectangle($im, 10, 10, 100, 100, $red, $blue);

There are other examples included in the GitHub repository and on imagegradientrectangle.agjgd.org.

Help Requests

Please post any questions in the discussions area on GitHub if you need help.

If you discover a bug please enter an issue on GitHub. When submitting an issue please use our issue template.

Contributing

Please read our contributing guidelines if you want to contribute.

You can contribute financially by becoming a patron at patreon.com/agjopensource to support imagegradientrectangle and other agjgd.org projects.

Patreon - Become a Patron

Acknowledgements

This project was started by Andrew G. Johnson (@andrewgjohnson).

Full list of contributors:

Our security policies and procedures comes via the atomist/samples project. Our issue templates comes via the tensorflow/tensorflow project. Our pull request template comes via the stevemao/github-issue-templates project. The mountains photo comes via Gabriel Garcia Marengo.

Changelog

You can find all notable changes in the changelog.