Beispiel #1
0
 /// <summary>
 /// Creates a new instance of GradientPattern
 /// </summary>
 public GradientPattern()
 {
     _gradientType = GradientType.Linear;
     _colors       = new Color[2];
     _colors[0]    = SymbologyGlobal.RandomLightColor(1F);
     _colors[1]    = _colors[0].Darker(.3F);
     _positions    = new[] { 0F, 1F };
     _angle        = -45;
 }
Beispiel #2
0
        /// <summary>
        /// Occurs during the randomize process and allows future overriding of the process for sub-classes
        /// </summary>
        /// <param name="generator"></param>
        protected override void OnRandomize(Random generator)
        {
            // randomize properties of the base class & any properties that are types that implement IRandomizable
            base.OnRandomize(generator);

            // randomize whatever is left
            _useOutline   = (generator.Next(0, 1) == 1);
            _outlineColor = SymbologyGlobal.RandomColor();
            _outlineWidth = generator.Next();
        }
 /// <summary>
 /// This constructor takes on some default values, and assumes that it
 /// has no other underlying symblizer to reference.
 /// </summary>
 public FeatureSymbolizerOld()
 {
     // Use the property to also set FillColor
     _fillColor            = SymbologyGlobal.RandomColor();
     _fillBrush            = new SolidBrush(_fillColor);
     _opacity              = 1f;
     _isVisible            = true; // This is boolean and should be true by default
     _smoothing            = SmoothingMode.AntiAlias;
     LegendType            = LegendType.Symbol;
     base.LegendSymbolMode = SymbolMode.Symbol;
 }
Beispiel #4
0
        private void Configure()
        {
            Symbols = new CopyList <ISymbol>();
            ISimpleSymbol ss = new SimpleSymbol();

            ss.Color      = SymbologyGlobal.RandomColor();
            ss.Opacity    = 1F;
            ss.PointShape = PointShape.Rectangle;
            Smoothing     = true;
            ScaleMode     = ScaleMode.Symbolic;
            Symbols.Add(ss);
        }
Beispiel #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EditorSettings"/> class.
 /// </summary>
 public EditorSettings()
 {
     _hsl                    = true;
     _useColor               = true;
     _startColor             = SymbologyGlobal.ColorFromHsl(5, .7, .7);
     _endColor               = SymbologyGlobal.ColorFromHsl(345, .8, .8);
     _maxSampleCount         = 10000;
     _intervalMethod         = IntervalMethod.EqualInterval;
     _rampColors             = true;
     _intervalSnapMethod     = IntervalSnapMethod.DataValue;
     _intervalRoundingDigits = 0;
     _numBreaks              = 5;
 }
Beispiel #6
0
        /// <summary>
        /// Creates a color with the same hue and saturation but that is slightly darker than this color.
        /// </summary>
        /// <param name="self">The starting color.</param>
        /// <param name="brightness">The floating point value of brightness to add to this color.</param>
        /// if the combined result is less than 0, the result will equal 0.
        /// <returns>A color darker than this color.</returns>
        public static Color Darker(this Color self, float brightness)
        {
            float b = self.GetBrightness() - brightness;

            if (b < 0F)
            {
                b = 0F;
            }
            if (b > 1F)
            {
                b = 1F;
            }
            return(Color.FromArgb(self.A, SymbologyGlobal.ColorFromHsl(self.GetHue(), self.GetSaturation(), b)));
        }
Beispiel #7
0
        private static List <Color> CreateRampColors(int numColors, float minSat, float minLight, int minHue, float maxSat, float maxLight, int maxHue, int hueShift, int minAlpha, int maxAlpha)
        {
            List <Color> result = new List <Color>(numColors);
            double       ds     = (maxSat - (double)minSat) / numColors;
            double       dh     = (maxHue - (double)minHue) / numColors;
            double       dl     = (maxLight - (double)minLight) / numColors;
            double       dA     = (maxAlpha - (double)minAlpha) / numColors;

            for (int i = 0; i < numColors; i++)
            {
                double h = (minHue + dh * i) + hueShift % 360;
                double s = minSat + ds * i;
                double l = minLight + dl * i;
                float  a = (float)(minAlpha + dA * i) / 255f;
                result.Add(SymbologyGlobal.ColorFromHsl(h, s, l).ToTransparent(a));
            }
            return(result);
        }
Beispiel #8
0
        private static List <Color> CreateRampColors(int numColors, float minSat, float minLight, int minHue, float maxSat, float maxLight, int maxHue, int hueShift, int minAlpha, int maxAlpha)
        {
            var result = new List <Color>(numColors);
            var ds     = (maxSat - (double)minSat) / numColors;
            var dh     = (maxHue - (double)minHue) / numColors;
            var dl     = (maxLight - (double)minLight) / numColors;
            var dA     = (maxAlpha - (double)minAlpha) / numColors;

            for (var i = 0; i < numColors; i++)
            {
                var h = (minHue + (dh * i)) + (hueShift % 360);
                var s = minSat + (ds * i);
                var l = minLight + (dl * i);
                var a = (float)(minAlpha + (dA * i)) / 255f;
                result.Add(SymbologyGlobal.ColorFromHsl(h, s, l).ToTransparent(a));
            }

            return(result);
        }
Beispiel #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CartographicStroke"/> class.
 /// </summary>
 public CartographicStroke()
 {
     Color = SymbologyGlobal.RandomDarkColor(1);
     Configure();
 }
Beispiel #10
0
 public MarkerStroke() : base(StrokeStyle.Marker)
 {
     Marker = new PointSymbolizer(SymbologyGlobal.RandomColor(), PointShape.Triangle, 10);
 }
Beispiel #11
0
 public SimpleStroke(StrokeStyle strokeStyle) : this(1, SymbologyGlobal.RandomDarkColor(1), strokeStyle)
 {
 }
Beispiel #12
0
 private void Configure()
 {
     ScaleMode        = ScaleMode.Simple;
     _borderIsVisible = true;
     FillColor        = SymbologyGlobal.RandomLightColor(1);
 }
Beispiel #13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CartographicStroke"/> class.
 /// </summary>
 public CartographicStroke() : this(SymbologyGlobal.RandomDarkColor(1))
 {
 }
Beispiel #14
0
 private void Configure()
 {
     base.SymbolType = SymbolType.Simple;
     _color          = SymbologyGlobal.RandomColor();
     _pointShape     = PointShape.Rectangle;
 }
Beispiel #15
0
 /// <summary>
 /// Creates a new instance of SimpleStroke
 /// </summary>
 public SimpleStroke()
 {
     _color = SymbologyGlobal.RandomDarkColor(1);
     _width = 1;
 }
Beispiel #16
0
 public CartographicStroke(StrokeStyle strokeStyle) : this(SymbologyGlobal.RandomDarkColor(1), strokeStyle)
 {
 }
Beispiel #17
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SimpleStroke"/> class.
 /// </summary>
 /// <param name="width">The double width of the line to set</param>
 public SimpleStroke(double width) : this(width, SymbologyGlobal.RandomDarkColor(1))
 {
 }
Beispiel #18
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SimplePattern"/> class.
        /// </summary>
        public SimplePattern()
        {
            Color c = SymbologyGlobal.RandomLightColor(1F);

            Configure(c);
        }