Skip to main content
All docs
V25.2
  • Create and Modify Color Palettes

    • 2 minutes to read

    To create new or modify existing palettes, you can click the “Edit…” button in the Project Settings Page.

    Color Palettes

    SvgPalette svgPalette = new SvgPalette();
    svgPalette.Colors.Add(new SvgColor("Paint", Color.FromArgb(242, 242, 242)));
    svgPalette.Colors.Add(new SvgColor("Paint High", Color.FromArgb(255, 255, 255)));
    svgPalette.Colors.Add(new SvgColor("Paint Shadow", Color.FromArgb(222, 222, 222)));
    svgPalette.Colors.Add(new SvgColor("Brush", Color.FromArgb(80, 80, 80)));
    svgPalette.Colors.Add(new SvgColor("Brush Light", Color.FromArgb(150, 150, 150)));
    svgPalette.Colors.Add(new SvgColor("Brush High", Color.FromArgb(80, 80, 80)));
    svgPalette.Colors.Add(new SvgColor("Brush Major", Color.FromArgb(180, 180, 180)));
    svgPalette.Colors.Add(new SvgColor("Brush Minor", Color.FromArgb(210, 210, 210)));
    svgPalette.Colors.Add(new SvgColor("Accent Paint", Color.FromArgb(23, 107, 209)));
    svgPalette.Colors.Add(new SvgColor("Accent Paint Light", Color.FromArgb(191, 224, 255)));
    svgPalette.Colors.Add(new SvgColor("Accent Brush", Color.FromArgb(255, 255, 255)));
    svgPalette.Colors.Add(new SvgColor("Accent Brush Light", Color.FromArgb(81, 148, 224)));
    svgPalette.Colors.Add(new SvgColor("Key Paint", Color.FromArgb(71, 71, 71)));
    svgPalette.Colors.Add(new SvgColor("Key Brush", Color.FromArgb(255, 255, 255)));
    svgPalette.Colors.Add(new SvgColor("Key Brush Light", Color.FromArgb(150, 150, 150)));
    svgPalette.Colors.Add(new SvgColor("Red", Color.FromArgb(226, 54, 66)));
    svgPalette.Colors.Add(new SvgColor("Green", Color.FromArgb(60, 146, 92)));
    svgPalette.Colors.Add(new SvgColor("Blue", Color.FromArgb(58, 116, 194)));
    svgPalette.Colors.Add(new SvgColor("Yellow", Color.FromArgb(252, 169, 10)));
    svgPalette.Colors.Add(new SvgColor("Black", Color.FromArgb(122, 122, 122)));
    svgPalette.Colors.Add(new SvgColor("Gray", Color.FromArgb(190, 190, 190)));
    svgPalette.Colors.Add(new SvgColor("White", Color.FromArgb(255, 255, 255)));
    
    // Obtain a vector skin
    var commonSkin = CommonSkins.GetSkin(LookAndFeel);
    // Replace the default color palette with a custom palette
    commonSkin.SvgPalettes[Skin.DefaultSkinPaletteName].CustomPalette = svgPalette;
    LookAndFeelHelper.ForceDefaultLookAndFeelChanged();
    // Or add a new palette
    commonSkin.CustomSvgPalettes.Add(new SvgPaletteKey(commonSkin.CustomSvgPalettes.Count, "PALETTE_NAME"), svgPalette);
    
    See Also