PHPackages                             venca-x/latte-contrast-yiq - 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. venca-x/latte-contrast-yiq

ActiveLibrary

venca-x/latte-contrast-yiq
==========================

Plugin for Nette. Default usage is for Latte templates. From RGB color return contrast color black/white

012PHP

Since Jan 5Pushed 8y ago1 watchersCompare

[ Source](https://github.com/venca-x/latte-contrast-yiq)[ Packagist](https://packagist.org/packages/venca-x/latte-contrast-yiq)[ RSS](/packages/venca-x-latte-contrast-yiq/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

Latte-contrast-yiq
==================

[](#latte-contrast-yiq)

[![Build Status](https://camo.githubusercontent.com/02df2c69a14cc820c92a2bf9240a942a2f0e2e4c71cd13e8273b78e32b298679/68747470733a2f2f7472617669732d63692e6f72672f76656e63612d782f6c617474652d636f6e74726173742d7969712e737667)](https://travis-ci.org/venca-x/latte-contrast-yiq)[![Latest Stable Version](https://camo.githubusercontent.com/3c205845fbc6c1a8abee8af7957a98c134941c480cdd8a6d5c90e4e7c97a763c/68747470733a2f2f706f7365722e707567782e6f72672f76656e63612d782f6c617474652d636f6e74726173742d7969712f762f737461626c652e737667)](https://packagist.org/packages/venca-x/latte-contrast-yiq)[![Total Downloads](https://camo.githubusercontent.com/6239153d84a8835a9a77600ffdb1c63066d699acb0b4043ebbe1dd73f9d557de/68747470733a2f2f706f7365722e707567782e6f72672f76656e63612d782f6c617474652d636f6e74726173742d7969712f646f776e6c6f6164732e737667)](https://packagist.org/packages/venca-x/latte-contrast-yiq)[![Latest Unstable Version](https://camo.githubusercontent.com/3441b5f2d2554150bb3ef138541486bea58817e32cd855ee110905315022a64f/68747470733a2f2f706f7365722e707567782e6f72672f76656e63612d782f6c617474652d636f6e74726173742d7969712f762f756e737461626c652e737667)](https://packagist.org/packages/venca-x/latte-contrast-yiq)[![License](https://camo.githubusercontent.com/f384afd710e693d6ddaec1a34e7a84d07a9d5bf655a81a8e31d87b98d253528e/68747470733a2f2f706f7365722e707567782e6f72672f76656e63612d782f6c617474652d636f6e74726173742d7969712f6c6963656e73652e737667)](https://packagist.org/packages/venca-x/latte-contrast-yiq)

Plugin for Nette. Default usage is for Latte templates. From RGB color return contrast color black/white. Typical set contrast text color for dynamic color background.

Installation
------------

[](#installation)

1. Add the bundle to your dependencies:

Install with composer:

```
	composer require venca-x/latte-contrast-yiq:~0.2

// composer.json

    {
       // ...
       "require": {
           // ...
		   "venca-x/latte-contrast-yiq": "@dev",
       }
    }

```

2. Use Composer to download and install the bundle:

    ```
    composer update

    ```

Configuration
-------------

[](#configuration)

BasePresenter.php

```
protected function beforeRender()
{
    parent::beforeRender();

    $this->template->addFilter('contrastYIQ', function ($text) {
        $contrastYIQ = new \ContrastYIQ();
        return $contrastYIQ->getContrastYIQ($text);
    });
}
```

Usage
-----

[](#usage)

```
{$o->color|contrastYIQ}
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/118375a8804ba0a6a9e67531be1064cf2cf1ddd4669de5ca7cdc6f1618add53e?d=identicon)[venca-x](/maintainers/venca-x)

---

Top Contributors

[![venca-x](https://avatars.githubusercontent.com/u/4173836?v=4)](https://github.com/venca-x "venca-x (11 commits)")

### Embed Badge

![Health badge](/badges/venca-x-latte-contrast-yiq/health.svg)

```
[![Health](https://phpackages.com/badges/venca-x-latte-contrast-yiq/health.svg)](https://phpackages.com/packages/venca-x-latte-contrast-yiq)
```

PHPackages © 2026

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