Let clients choose from a predefined set of colours.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
resources/img
src
.gitignore
.scrutinizer.yml
CHANGELOG.md
LICENSE.md
README.md
composer.json
composer.lock

README.md

Icon

Latest Version Quality Score StyleCI Total Downloads

Colour Swatches plugin for Craft CMS 3.x

Let clients choose from a predefined set of colours.

Support Open Source. Buy beer.

This plugin is licensed under a MIT license, which means that it's completely free open source software, and you can use it for whatever and however you wish. If you're using it and want to support the development, buy me a beer over at Beerpay!

Beerpay

Requirements

This plugin requires Craft CMS 3.0.0-beta.23 or later.

Installation

To install the plugin, follow these instructions.

  1. Open your terminal and go to your Craft project:

     cd /path/to/project
    
  2. Then tell Composer to load the plugin:

     composer require rias/craft-colour-swatches
    
  3. In the Control Panel, go to Settings → Plugins and click the “Install” button for Colour Swatches.

Colour Swatches Overview

Instead of providing a user a full color picker, Color Swatches gives an admin the ability to provide a selection of colors for a user to choose from.

Configuring Colour Swatches

Create a Color Swatches field and provide label and hex value options.

Screenshot

Multiple colours are possible by seperating them with a comma

Screenshot

Using Colour Swatches

You can access both the label and color in your template. By default, the label will display:

{{ fieldName }}
{{ fieldName.label }}
{{ fieldName.color }}
{{ fieldName.colours }} {# Returns an array of all colours #}

Based on the awesome Craft 2 plugin from Vigetlabs

Brought to you by Rias