ColorPicker
ColorPicker
Overview
This sample shows the basic usage of the ColorPicker control.
Features
#ffffff
Settings
ShowAlphaChannel: True
ShowColorString: False
Description
This sample shows the basic usage of the ColorPicker control.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | using System.Collections.Generic; using Microsoft.AspNetCore.Mvc; using MvcExplorer.Models; namespace MvcExplorer.Controllers { public partial class ColorPickerController : Controller { public ActionResult Index() { ViewBag.DemoSettings = true ; ViewBag.DemoSettingsModel = new ClientSettingsModel { Settings = CreateSettings() }; return View(); } private static IDictionary< string , object []> CreateSettings() { var settings = new Dictionary< string , object []> { { "ShowAlphaChannel" , new object []{ true , false }}, { "ShowColorString" , new object []{ false , true }} }; return settings; } } } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | @ { ClientSettingsModel settings = ViewBag.DemoSettingsModel; var palette = new List< string > { "Red" , "Green" , "Blue" }; } < div > < label >ColorPicker</ label > < c1-color-picker id = "@settings.ControlId" palette = "@palette" width = "400px" > </ c1-color-picker > </ div > @section Description{ @Html .Raw(ColorPickerRes.Index_Text0) } |