Esempio n. 1
0
 public override bool Read(GH_IReader reader)
 {
     if (reader.ItemExists("Gradient"))
     {
         var dist = reader.GetString("Gradient");
         Gradient = Utils.GradientFromString(dist);
     }
     return(base.Read(reader));
 }
 /// <summary>
 /// Creates a new instance of a Gradient Pattern using the specified colors and angle
 /// </summary>
 /// <param name="startColor">The start color</param>
 /// <param name="endColor">The end color</param>
 /// <param name="angle">The direction of the gradient, measured in degrees clockwise from the x-axis</param>
 public GradientPattern(Color startColor, Color endColor, double angle)
 {
     _gradientType = GradientTypes.Linear;
     _colors = new Color[2];
     _colors[0] = startColor;
     _colors[1] = endColor;
     _positions = new[] { 0F, 1F };
     _angle = angle;
 }
 /// <summary>
 /// Creates a new instance of GradientPattern
 /// </summary>
 public GradientPattern()
 {
     _gradientType = GradientTypes.Linear;
     _colors = new Color[2];
     _colors[0] = Global.RandomLightColor(1F);
     _colors[1] = _colors[0].Darker(.3F);
     _positions = new[] { 0F, 1F };
     _angle = -45;
 }
Esempio n. 4
0
        public void appendMenu(GradientTypes it, ToolStripDropDown menu)
        {
            var u = this;

            Menu_AppendItem(
                menu,
                Utils.GradientToStringR(it),
                ((_, __) => { u.Gradient = it; u.ExpireSolution(true); }),
                true, u.Gradient == it);
        }
Esempio n. 5
0
 public static string GradientToStringR(GradientTypes u) => u.ToString().Replace("_", " ");
 /// <summary>
 /// Creates a new instance of a Gradient Pattern using the specified colors and angle
 /// </summary>
 /// <param name="startColor">The start color</param>
 /// <param name="endColor">The end color</param>
 /// <param name="angle">The direction of the gradient, measured in degrees clockwise from the x-axis</param>
 /// <param name="style">Controls how the gradient is drawn</param>
 public PolygonSymbolizer(Color startColor, Color endColor, double angle, GradientTypes style)
 {
     _patterns = new CopyList<IPattern>();
     _patterns.Add(new GradientPattern(startColor, endColor, angle, style));
 }
 /// <summary>
 /// Creates a new instance of a Gradient Pattern using the specified colors and angle
 /// </summary>
 /// <param name="startColor">The start color</param>
 /// <param name="endColor">The end color</param>
 /// <param name="angle">The direction of the gradient, measured in degrees clockwise from the x-axis</param>
 /// <param name="style">The type of gradient to use</param>
 /// <param name="outlineColor">The color to use for the border symbolizer</param>
 /// <param name="outlineWidth">The width of the line to use for the border symbolizer</param>
 public PolygonSymbolizer(Color startColor, Color endColor, double angle, GradientTypes style, Color outlineColor, double outlineWidth)
 {
     _patterns = new CopyList<IPattern>();
     _patterns.Add(new GradientPattern(startColor, endColor, angle, style));
     OutlineSymbolizer = new LineSymbolizer(outlineColor, outlineWidth);
 }
 /// <summary>
 /// Creates a new instance of a Gradient Pattern using the specified colors and angle
 /// </summary>
 /// <param name="startColor">The start color</param>
 /// <param name="endColor">The end color</param>
 /// <param name="angle">The direction of the gradient</param>
 /// <param name="style">The type of gradient to use</param>
 /// <param name="outlineColor">The color to use for the border symbolizer</param>
 /// <param name="outlineWidth">The width of the line to use for the border symbolizer</param>
 public PolygonCategory(Color startColor, Color endColor, double angle, GradientTypes style, Color outlineColor, double outlineWidth)
 {
     Symbolizer = new PolygonSymbolizer(startColor, endColor, angle, style, outlineColor, outlineWidth);
     SelectionSymbolizer = new PolygonSymbolizer(Color.LightCyan, Color.DarkCyan, angle, style, Color.DarkCyan, outlineWidth);
 }