PHPackages                             xu-chris/contrastcolor - 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. xu-chris/contrastcolor

ActiveKirby-plugin[Utility &amp; Helpers](/categories/utility)

xu-chris/contrastcolor
======================

Calculates contrast color for given HEX color

v0.0.7(10mo ago)0109MITPHPPHP &gt;=8.1.0

Since Dec 9Pushed 10mo ago1 watchersCompare

[ Source](https://github.com/xu-chris/kirby-contrastcolor)[ Packagist](https://packagist.org/packages/xu-chris/contrastcolor)[ RSS](/packages/xu-chris-contrastcolor/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)Dependencies (2)Versions (6)Used By (0)

Contrast Color for Kirby CMS 4.0
================================

[](#contrast-color-for-kirby-cms-40)

Adds `toContrastColor()` to calculate wether using a white or a black color for a given image color in Kirby.

1 Installation
--------------

[](#1-installation)

Download and copy this repository to `site/plugins/contrastcolor` or use compose:

```
compose require xu-chris/contrastcolor

```

2 Blueprint for image files
---------------------------

[](#2-blueprint-for-image-files)

For images, you can create a blueprint that adds a color field:

```
title: Image
accept:
  mime: image/jpeg, image/png
fields:
  color:
    label: Dominant color
    type: color
    format: hex

```

3 Use this plugin
-----------------

[](#3-use-this-plugin)

Given an image with a color, you can use it like this:

```
$image->color()->toContrastColor()

```

Currently, it's limited for HEX color values automatically calculated

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance54

Moderate activity, may be stable

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

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

Every ~115 days

Recently: every ~144 days

Total

6

Last Release

309d ago

PHP version history (2 changes)0.0.1PHP &gt;=8.1.0 &lt;8.4.0

v0.0.5PHP &gt;=8.1.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/ee3bb8a2af551ff3462f9c9b01f82f79c07646f9abfcd7fb7248d111e1a4c7a1?d=identicon)[xu-chris](/maintainers/xu-chris)

---

Top Contributors

[![xu-chris](https://avatars.githubusercontent.com/u/980778?v=4)](https://github.com/xu-chris "xu-chris (1 commits)")

### Embed Badge

![Health badge](/badges/xu-chris-contrastcolor/health.svg)

```
[![Health](https://phpackages.com/badges/xu-chris-contrastcolor/health.svg)](https://phpackages.com/packages/xu-chris-contrastcolor)
```

###  Alternatives

[distantnative/retour-for-kirby

Manage redirects and track 404s right from the Kirby CMS Panel

14689.4k1](/packages/distantnative-retour-for-kirby)[arnoson/kirby-vite

Vite helper for Kirby CMS

9759.2k3](/packages/arnoson-kirby-vite)[oblik/kirby-link-field

Kirby 4 field for all types of links.

7650.6k2](/packages/oblik-kirby-link-field)[belugadigital/kirby-navigation

Kirby 5 field for hierarchical menus with drag &amp; drop level indentation.

8713.4k](/packages/belugadigital-kirby-navigation)[rasteiner/k3-whenquery

Conditionally show fields and sections. Better.

6717.8k](/packages/rasteiner-k3-whenquery)[fabianmichael/kirby-meta

Your all-in-one powerhouse for any SEO and metadata needs imaginable.

6910.7k1](/packages/fabianmichael-kirby-meta)

PHPackages © 2026

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