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
1.0.2
1.0.1
1.0.0