PHPackages                             bogdancondorachi/kirby-colour-swatch-field - 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. bogdancondorachi/kirby-colour-swatch-field

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

bogdancondorachi/kirby-colour-swatch-field
==========================================

Colour swatch field for Kirby CMS

1.0.1(8mo ago)1121MITVuePHP &gt;=8.2.0 &lt;8.5.0

Since Sep 26Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/bogdancondorachi/kirby-colour-swatch-field)[ Packagist](https://packagist.org/packages/bogdancondorachi/kirby-colour-swatch-field)[ Docs](https://github.com/bogdancondorachi/kirby-colour-swatch-field)[ GitHub Sponsors](https://github.com/bogdancondorachi)[ RSS](/packages/bogdancondorachi-kirby-colour-swatch-field/feed)WikiDiscussions main Synced today

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

Kirby Colour Swatch Field
=========================

[](#kirby-colour-swatch-field)

Note

A simple color field extention that allows to pass options like 'hex', 'class' or 'title' for [Kirby CMS](https://getkirby.com).

📦 Installation
--------------

[](#-installation)

### Composer

[](#composer)

```
composer require bogdancondorachi/kirby-colour-swatch-field
```

### Git Submodule

[](#git-submodule)

```
git submodule add https://github.com/bogdancondorachi/kirby-colour-swatch-field.git site/plugins/colour-swatch-field
```

### Manual

[](#manual)

[Download the plugin](https://api.github.com/repos/bogdancondorachi/kirby-colour-swatch-field/zipball) and extract it to: `/site/plugins/colour-swatch-field`

⚙️ Usage
--------

[](#️-usage)

### Add the field to your blueprint:

[](#add-the-field-to-your-blueprint)

```
bgColor:
  label: Background Color
  type: swatch
  options:
    amber:
      hex: 'FFB900'
      title: Amber
      class: bg-amber-400
    emerald:
      hex: '009966'
      title: Apricot
      class: bg-emerald-600
    white:
      hex: 'FFFFFF'
      title: White
      class: bg-white
    black:
      hex: '000000'
      title: Black
      class: bg-black
```

### Use the field in your template:

[](#use-the-field-in-your-template)

```
// Outputs the selected color title as a string
$page->bgColor()->toSwatch('title')

// Outputs the selected color hex code as a string (without preceding #)
$page->bgColor()->toSwatch('hex')

// Outputs the selected color class as a string
$page->bgColor()->toSwatch('class')
```

🙏 Credits
---------

[](#-credits)

- [Chris Martin](https://github.com/chrisbeluga) for his [Kirby Color Selection](https://github.com/chrisbeluga/kirby-colors), which served as base for this project.

📜 License
---------

[](#-license)

[MIT License](./LICENSE) Copyright © 2024 [Bogdan Condorachi](https://github.com/bogdancondorachi)

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance62

Regular maintenance activity

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

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 ~39 days

Total

2

Last Release

243d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9eaf70d8b4bb15f56f486bc83603613139479b751806cda601a7187ebd07bccf?d=identicon)[bogdancondorachi](/maintainers/bogdancondorachi)

---

Top Contributors

[![bogdancondorachi](https://avatars.githubusercontent.com/u/39380741?v=4)](https://github.com/bogdancondorachi "bogdancondorachi (3 commits)")

### Embed Badge

![Health badge](/badges/bogdancondorachi-kirby-colour-swatch-field/health.svg)

```
[![Health](https://phpackages.com/badges/bogdancondorachi-kirby-colour-swatch-field/health.svg)](https://phpackages.com/packages/bogdancondorachi-kirby-colour-swatch-field)
```

###  Alternatives

[getkirby/cms

The Kirby core

1.5k584.8k476](/packages/getkirby-cms)[medienbaecker/kirby-modules

Easily add modules to your pages

895.5k1](/packages/medienbaecker-kirby-modules)[distantnative/retour-for-kirby

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

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

Vite helper for Kirby CMS

9765.1k3](/packages/arnoson-kirby-vite)[bnomei/kirby3-dotenv

Kirby Plugin for environment variables from .env

4149.6k2](/packages/bnomei-kirby3-dotenv)[medienbaecker/kirby-alter

242.1k](/packages/medienbaecker-kirby-alter)

PHPackages © 2026

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