Color Swatches

Color Swatches
Description

Color 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.

Using Color Swatches

Add the fieldtype to your fieldset, you can define multiple colors for a swatch by using a YAML array. You can also set a default color by entering the label.

sections:
  main:
    display: Main
    fields:
      color:
        type: color_swatches
        colors:
          red: '#E3342F'
          orange: '#F6993F'
          green: '#38C172'
          blue-yellow:
            - '#4299E1'
            - '#ECC94B'
        default: blue

Using Color Swatches

You can access both the label and color in your template.

{{ color.label }}
{{ color.value }}
{{ color.value[0] }} #If it's more than one color

Important Links
Details
Released April 16, 2019
Updated 3 weeks ago
Version v1.0.2
Downloads 37
Requires Statamic 2

Rias.be

More by Rias.be

Similar Addons

See All
Provide better UX by letting clients choose from position icons. $5

Position Fieldtype

by Rias.be in Fieldtype
Provide better UX by letting clients choose from position icons.
Anchorman allows you to automatically populate collections with articles from different RSS/Atom feeds. $39

Anchorman

by Wout Mager in Enhancement, Tool, Utility
Anchorman allows you to automatically populate collections with articles from different RSS/Atom feeds.