public static void Mutate(this DnaBrush dnaBrush, DnaDrawing dnaDrawing)
        {
            if (Tools.WillMutate(Settings.ActiveRedMutationRate))
            {
                dnaBrush.Red = Tools.GetRandomNumber(Settings.ActiveRedRangeMin, Settings.ActiveRedRangeMax);
                dnaDrawing.SetDirty();
            }

            if (Tools.WillMutate(Settings.ActiveGreenMutationRate))
            {
                dnaBrush.Green = Tools.GetRandomNumber(Settings.ActiveGreenRangeMin, Settings.ActiveGreenRangeMax);
                dnaDrawing.SetDirty();
            }

            if (Tools.WillMutate(Settings.ActiveBlueMutationRate))
            {
                dnaBrush.Blue = Tools.GetRandomNumber(Settings.ActiveBlueRangeMin, Settings.ActiveBlueRangeMax);
                dnaDrawing.SetDirty();
            }

            if (Tools.WillMutate(Settings.ActiveAlphaMutationRate))
            {
                dnaBrush.Alpha = Tools.GetRandomNumber(Settings.ActiveAlphaRangeMin, Settings.ActiveAlphaRangeMax);
                dnaDrawing.SetDirty();
            }
        }
Example #2
0
        //Convert a DnaBrush to a System.Drawing.Brush
        private static Brush GetGdiBrush(DnaBrush b)
        {
            //var pb = new PathGradientBrush(points);
            //pb.CenterColor = Color.FromArgb(b.Alpha, b.Red, b.Green, b.Blue);
            //pb.SurroundColors = new Color[] {Color.Transparent};

            //return pb;

            return(new SolidBrush(Color.FromArgb(b.Alpha, b.Red, b.Green, b.Blue)));
        }
Example #3
0
        public override void Init()
        {
            origin = new DnaPoint();
            origin.Init(tool);

            Brush = new DnaBrush();
            Brush.Init(tool);

            rx = ry = tool.GetRandomNumber(0, Settings.ActiveMaxCircleRadius);
            rotation = 0;
        }
Example #4
0
        public new void Init()
        {
            origin = new DnaPoint();
            origin.Init(tool);

            Brush = new DnaBrush();
            Brush.Init(tool);

            rx = ry = tool.GetRandomNumber(0.0, 5.0);
            rotation = 0;
        }
Example #5
0
        public virtual void Init()
        {
            origin = new DnaPoint();
            origin.Init(tool);

            Brush = new DnaBrush();
            Brush.Init(tool);

            rx = tool.GetRandomNumber(0, Settings.ActiveMaxCircleRadius);
            ry = tool.GetRandomNumber(0, Settings.ActiveMaxCircleRadius);
            rotation = tool.GetRandomNumber(-99.0, 99.0);
        }
Example #6
0
        public void Init()
        {
            Points = new List<DnaPoint>();

            //int count = Tools.GetRandomNumber(3, 3);
            var origin = new DnaPoint();
            origin.Init(tool);

            for (int i = 0; i < Settings.ActivePointsPerPolygonMin; i++)
            {
                var point = new DnaPoint();
                point.X = Math.Min(Math.Max(0, origin.X + tool.GetRandomNumber(-3, 3)), Tools.MaxWidth);
                point.Y = Math.Min(Math.Max(0, origin.Y + tool.GetRandomNumber(-3, 3)), Tools.MaxHeight);

                Points.Add(point);
            }

            Brush = new DnaBrush();
            Brush.Init(tool);
        }
Example #7
0
 //Convert a DnaBrush to a System.Drawing.Brush
 public static Brush GetGdiBrush(DnaBrush b)
 {
     return new SolidBrush(Color.FromArgb(b.Alpha, b.Red, b.Green, b.Blue));
 }
Example #8
0
 //Convert a DnaBrush to a System.Drawing.Brush
 private static Brush GetGdiBrush(DnaBrush b)
 {
     return(new SolidBrush(Color.FromArgb(b.Alpha, b.Red, b.Green, b.Blue)));
 }