Restrict colors in Tinymce font color plugin



So i have done below code to display toolbars and plugins in tinymce editor, recently i added font color and font background color toolbar as well and i can see it in editor but i want to restrict the colors which come under that.

public void ConfigureContainer(ServiceConfigurationContext context)
               context.Services.Configure<TinyMceConfiguration>(config =>

                      var DefaultTinyMceSettings = config.Default().AddPlugin(ToolbarButtons.EpiLink + " " + ToolbarButtons.Anchor + " " + ToolbarButtons.Image + "textcolor colorpicker")
                      .Toolbar(ToolbarButtons.EpiLink + " " + ToolbarButtons.Anchor + " " + ToolbarButtons.Image                                             , "forecolor backcolor");



I saw on Tinymce documentation and it says it has color_map property to restrict the colors but im not sure how we will do that here as there code is based on js.

Edited, Aug 14, 2020 8:22

Hi Swati,

Try this:

                .AddSetting("textcolor_map", new object[] {
                    "CC0000",  "Red",
                    "000000",  "Black",
                    "FFFFFF",  "White"
Edited, Aug 18, 2020 1:37
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.