Example of brushes menu setup

The page gives an example of setting up a list of brushes in JSON format.

NOTE. When XML is automatically converted to JSON, the "@" character, which does not need to be removed, appears before attributes.

"ItemsDictionary" :

{

//As a rule, the list of brushes is positioned at the start of item list.

//Simple brushes:

   "SolidColorBrush" :

   [

     {"Id" : "GrayBrush", "Color" : "Gray"},

     {"Id" : "ColorBrush","Color" : "Cyan"},

     {"Id" : "solid1","Color" : "#ffCBE5F2"},

     {"Id" : "solid2","Color" : "#ffA6C4D7"},

     {"Id" : "solid3","Color" : "#ff82A4BC"},

     {"Id" : "solid4","Color" : "#ff6085A3"},

     {"Id" : "solid5","Color" : "#ff345D83"},

     {"Id" : "solid6","Color" : "#ffC3C3C3"}

   ],

//Linear gradient brush

   "LinearGradientBrush" :

     { "EndPoint" : "1, 1",

       "StartPoint" : "0, 0",

       "Id" : "LinearGradient",

       "LinearGradientBrush.GradientStops" :

         {

           "GradientStop" :

             [

                {"Offset" : "0","Color" : "#ffdd00cc"},

                {"Offset" : "1","Color" : "#ffaaffcc"}

             ]

         }

     },

//Radial gradient brush

   "RadialGradientBrush" :

     {

        "@Center" : "0.5, 0.5",

        "@Id" : "RadialGradient",

        "RadialGradientBrush.GradientStops" :

           {

             "GradientStop" :

              [

                 {"@Offset" : "0", "@Color" : "#ff000000"},

                 {"@Offset" : "1", "@Color" : "#ffffffdd"}

              ]

            }

      }

//It is typically followed by the list of fonts.

}

See also:

Brushes