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(6mo ago)159MITVuePHP &gt;=8.2.0 &lt;8.5.0

Since Sep 26Pushed 6mo 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 1mo ago

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

38

—

LowBetter than 85% of packages

Maintenance68

Regular maintenance activity

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

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

189d 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

[distantnative/retour-for-kirby

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

14689.4k1](/packages/distantnative-retour-for-kirby)[mzur/kirby-uniform

A versatile Kirby plugin to handle web form actions.

26068.3k13](/packages/mzur-kirby-uniform)[arnoson/kirby-vite

Vite helper for Kirby CMS

9759.2k3](/packages/arnoson-kirby-vite)[thathoff/kirby-git-content

Plugin to track changes to content in a git repository.

15343.7k](/packages/thathoff-kirby-git-content)[sylvainjule/locator

A map &amp; geolocation field, built on top of open-source services / Mapbox

11237.3k1](/packages/sylvainjule-locator)[tobimori/kirby-seo

The default choice for SEO on Kirby: Implement technical SEO &amp; Meta best practices with ease and provide an easy-to-use editor experience

10039.7k1](/packages/tobimori-kirby-seo)

PHPackages © 2026

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