22 votes

Color Palettes

Color Palettes is a simple property editor that let you define different color palettes and present them to the editor as a list of radio buttons.

It is also possible to request defined color palettes from Adobe Kuler or COLOURlovers 
by entering the theme/palette id.

This package can be useful if you want to use a specific style/theme for the page (e.g. by adding the palette alias to <body>), use styles on specific elements or widgets.


To use the selected palette in your razor view add the following namespaces:

@using Our.Umbraco.ColorPalettes.Models;
@using Our.Umbraco.ColorPalettes.Converters;

 

and to get the selected palette:

Strongly typed example

ColorPalette palette = Model.Content.GetPropertyValue<ColorPalette>("theme");
var colors = palette.Colors;

 

Dynamic example

ColorPalette palette = (ColorPalette)CurrentPage.theme;
var colors = palette.Colors;

or

var colors = ((ColorPalette)CurrentPage.theme).Colors;

 

You can also loop through each color defined in the palette:

@foreach (var color in palette.Colors)
{
        @color.Code;
}

 

or get a specific color in the palette:

string color1 = palette.Colors.ElementAt(0).Code,
       color2 = palette.Colors.ElementAt(1).Code,
       color3 = palette.Colors.ElementAt(2).Code,
       color4 = palette.Colors.ElementAt(3).Code,
       color5 = palette.Colors.ElementAt(4).Code;

 

Since Umbraco 7.4 also include ng-file-upload, there is an issue uploading files in media section while Color Palettes is installed. To fix this in Umbraco 7.4.0 - 7.4.2 you can remove or uncomment this line in package.manifest:

"~/App_Plugins/ColorPalettes/modules/ng-file-upload.js"

 

In Umbraco 7.4.3 it should be fixed, so it doesn't conflict with core: http://issues.umbraco.org/issue/U4-8265

 

1.0.3

  • FIX: Style adjustments for labels in Umbraco 7.4.0
  • NEW: Add manifest group and icon properties for use in new document type editor in Umbraco 7.4.0

1.0.2

  • NEW: Added option to export or import one or more palettes.

1.0.1

  • NEW: Added camelCase filter to autofill alias on first edit.


1.0.0

  • Initial release.

 

Screenshots

Package owner

Bjarne Fyrstenborg

Bjarne Fyrstenborg

Bjarne has 4039 karma points

Package Compatibility

This package is compatible with the following versions as reported by community members who have downloaded this package:
Untested or doesn't work on Umbraco Cloud
Version 8.18.x (untested)

You must login before you can report on package compatibility.

Previously reported to work on versions: 7.5.x, 7.4.x, 7.3.x, 7.2.x, 7.1.x

Package Information

  • Package owner: Bjarne Fyrstenborg
  • Created: 20/07/2015
  • Current version 1.0.3
  • .NET version 4.0
  • License MIT
  • Downloads on Our: 2K

External resources