PHPackages                             tei187/intensification-gradient - 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. tei187/intensification-gradient

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

tei187/intensification-gradient
===============================

IntensificationGradient is a PHP class used to generate a decimal-step-based RGBa gradient data arrays, based on defined stops. Especially usefull with intensification displays (like ticks per hour, visits per day, etc.) or compositions based on gradient range of limiting colors (brand guides, etc.).

07PHP

Since Oct 24Pushed 3y ago1 watchersCompare

[ Source](https://github.com/tei187/IntensificationGradient)[ Packagist](https://packagist.org/packages/tei187/intensification-gradient)[ RSS](/packages/tei187-intensification-gradient/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

IntensificationGradient
=======================

[](#intensificationgradient)

Ultimate gradient generator you may need after all.
---------------------------------------------------

[](#ultimate-gradient-generator-you-may-need-after-all)

---

IntensificationGradient is a PHP class used to generate a decimal-step-based RGBa gradient data arrays, based on defined stops. Especially usefull with intensification displays (like ticks per hour, visits per day, etc.) or compositions based on gradient range of limiting colors (brand guides, etc.). Works nicely when supplied with [RangeBasedPercentage](https://github.com/tei187/range-based-percentage) in order to find percentage-relative of a value between given range.

Features
--------

[](#features)

- Use any RGB markup syntax \*(ex. `128,31,187,50%`, `#fcad`, etc.)
- Return entire result table or just specific percent of the gradient
- Export resulting gradient in JSON format in RGB(a) or HEX transcription
- Use predefined gradients, like *heatmap*, *blackbody*, etc ***\[partially done\]***

How to use?
-----------

[](#how-to-use)

### Creating gradient from RGB(a) values

[](#creating-gradient-from-rgba-values)

```
$var = new tei187\IntensificationGradient\Generator;  // initiate object
$var->setValues(["#000", "#fff"]); // set values for gradient

echo $var->renderBar(); // renders gradient (requires CSS class assignment for proper display)

echo $var->result(51); // returns rgba(rrr,ggg,bbb,a) string for 51st step

echo $var->renderCell(85); // return echoable HTML object filled with color equivalent to 85th step of the gradient
```

### Creating gradient from predefined presets

[](#creating-gradient-from-predefined-presets)

```
$var = new tei187\IntensificationGradient\Generator;  // initiate object
$var->setValues("heatmap"); // set values from preset gradient
echo $var->renderBar();
```

Default gradients are (2021/10/12): `heatmap`, `blackbody`, `rgb`, `red`, `green`, `blue`, `b/w`, `gray`, `orange`, `violet`, `lime`, `cyan`, `magenta`, `yellow`, `aqua`, `blue-gray`, `bb`, `opb`, `ovb`, `nvg`, `color-temp`, `rastafari`, `argon-blue`, `r/g`, `facebook`, `google`, `instagram`, `lyft`, `twitch`, `skype`.

### Reverting gradient

[](#reverting-gradient)

Typed in the gradient from the opposite direction? Or maybe just need to switch it for some reason at some point? No problem, use the 'invert' method.

```
$var = new tei187\IntensificationGradient\Generator;  // initiate object
$var->setValues(["#f00", "#00f"]); // set values for gradient, from red to blue
$var->invert(); // reverts the gradient, from blue to red
```

### Exporting to JSON

[](#exporting-to-json)

It is also possible to export the resulting gradient range to JSON format.

```
$var = new tei187\IntensificationGradient\Generator;  // initiate object
$var->setValues(["#f00", "#00f"]); // set values for gradient, from red to blue
return $var->returnJSON();
```

### Generating preview page

[](#generating-preview-page)

There is also a possibility to render an entire HTML page for the outcome of Gradient range.

```
use tei187\IntensificationGradient\Generator as Generator;
use tei187\IntensificationGradient\HtmlPreview as HtmlPreview;
$gen = new Generator("opb"); // create Generator object
$prev = new HtmlPreview("Testing", $gen->returnArray(true)); // pass to HtmlPreview
echo $prev->buildPage();
```

### Default gradients

[](#default-gradients)

List of default preset gradients:

[![List of default gradients](https://camo.githubusercontent.com/a1cb738fa2a92828d575a0b0f9e3398ca6a0aec690087361e9360902a4b34905/68747470733a2f2f786f77657267732e7769727431362e62686c696e6b2e706c2f73747566662f496e74656e73696669636174696f6e4772616469656e745f64656661756c74732e6a7067)](https://camo.githubusercontent.com/a1cb738fa2a92828d575a0b0f9e3398ca6a0aec690087361e9360902a4b34905/68747470733a2f2f786f77657267732e7769727431362e62686c696e6b2e706c2f73747566662f496e74656e73696669636174696f6e4772616469656e745f64656661756c74732e6a7067)

Requirements
------------

[](#requirements)

- PHP &gt;= 7.3

Author
------

[](#author)

- [tei187](mailto:bonk.piotr@gmail.com)

###  Health Score

14

—

LowBetter than 2% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity24

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/b7ac98c5381a6fdd186d23f57126113fa3bf7e7b41077cb352f89fb8cdbd1c38?d=identicon)[tei187](/maintainers/tei187)

---

Top Contributors

[![tei187](https://avatars.githubusercontent.com/u/59267193?v=4)](https://github.com/tei187 "tei187 (24 commits)")

---

Tags

color-gradientgeneratorgradientgradient-generatorhex-colorshtml-outputintensificationphprgba-color

### Embed Badge

![Health badge](/badges/tei187-intensification-gradient/health.svg)

```
[![Health](https://phpackages.com/badges/tei187-intensification-gradient/health.svg)](https://phpackages.com/packages/tei187-intensification-gradient)
```

###  Alternatives

[mmoreram/extractor

Extractor project for php

21132.0k8](/packages/mmoreram-extractor)[magefan/module-auto-related-product

Extend native Magento Up-Sells, Cross-Sells, and Related products

1834.7k2](/packages/magefan-module-auto-related-product)[yidas/pagination

PHP Paginator with Pager Widget (pure PHP, CI, Yii, Laravel support)

2516.4k](/packages/yidas-pagination)[f-oris/easy-bytedance-miniapp

字节跳动小程序SDK

151.8k](/packages/f-oris-easy-bytedance-miniapp)

PHPackages © 2026

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