Пример #1
0
        public static OxyColor[] GenerateOxyColors(this ColorPalettes palette, Int32 length)
        {
            var colors        = new OxyColor[length];
            var args          = new Object[] { length };
            var paletteString = palette.ToString();
            var method        = typeof(OxyPalettes).GetMethod(paletteString);
            var oxyPalette    = default(OxyPalette);

            if (method != null)
            {
                oxyPalette = method.Invoke(null, args) as OxyPalette;
            }

            if (oxyPalette == null)
            {
                oxyPalette = OxyPalettes.Jet(length);
            }

            for (var i = 0; i < length; i++)
            {
                colors[i] = oxyPalette.Colors[i];
            }

            return(colors);
        }
        private void cbCustom_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            switch (cbCustom.SelectedIndex)
            {
            case 0:
                ColorPalettes.ApplyPalette(tChart1.Chart, Steema.TeeChart.Themes.Theme.OperaPalette);
                tChart1.Refresh();
                break;

            case 1:
                ColorPalettes.ApplyPalette(tChart1.Chart, RedPalette);
                tChart1.Refresh();
                break;

            case 2:
                ColorPalettes.ApplyPalette(tChart1.Chart, BluePalette);
                tChart1.Refresh();
                break;

            case 3:
                ColorPalettes.ApplyPalette(tChart1.Chart, GreenPalette);
                tChart1.Refresh();
                break;
            }
        }
Пример #3
0
    protected virtual void Start()
    {
        if (rotate)
        {
            StartCoroutine(Rotate());
        }

        MyColorPalette = ColorPalettes.ColorPalette_02; //TO-DO : Retrieve currently equipped color palette from a manager or saved data
    }
Пример #4
0
 public Color LightenColor(Color color)
 {
     if (use_hsv)
     {
         ColorPalettes.ColorToHSV(color, out double hue, out double saturation, out double value);
         var newSaturation = saturation < .5 ? saturation : (saturation + .5) / 2;
         var newValue      = value > .5 ? value : (value + .5) / 2;
         if (newSaturation == saturation && newValue == value)
         {
             return(color);
         }
         return(ColorPalettes.ColorFromHSV(hue, saturation / 2, (1 + value) / 2));
     }
     return(Color.FromArgb(color.A, LightenRgbComponent(color.R), LightenRgbComponent(color.G), LightenRgbComponent(color.B)));
 }
Пример #5
0
    private void Start()
    {
        MyColorPalette = ColorPalettes.ColorPalette_02; //TO-DO : Retrieve currently equipped color palette from a manager or saved data

        //Set color to a random color based on color palette
        //TO-DO: Set color from obstacle course controller instead if obstacles will be controlled
        int randomColorInt = Random.Range(0, ColorDictionary.Instance.Dict_ColorPalettes[MyColorPalette].Length);

        SetMyColor(randomColorInt);

        if (rotate)
        {
            StartCoroutine(Rotate());
        }
    }
Пример #6
0
        public HeatmapViewModel(HeatmapPlotValue value)
        {
            _value        = value;
            _title        = value[0].Label;
            _colorPalette = value.ColorPalette;
            _save         = new RelayCommand(x =>
            {
                var window          = x as Window;
                _value.ColorPalette = _colorPalette;
                _value[0].Label     = _title;
                _value.UpdateProperties();

                if (window != null)
                {
                    window.Close();
                }
            });
        }
Пример #7
0
    private void Start()
    {
        mainCamera     = Camera.main;
        lineRenderer   = directionRenderer.GetComponent <LineRenderer>();
        trailRenderer  = GetComponent <TrailRenderer>();
        rb             = GetComponent <Rigidbody2D>();
        spriteRenderer = GetComponent <SpriteRenderer>();
        gameController = FindObjectOfType <GameController>();

        CanDrag             = true;
        currentLaunchChance = launchChance;

        MyColorPalette = ColorPalettes.ColorPalette_02;

        StartCoroutine(RandomizeColor());
        StartCoroutine(EnableDragging());
        //gameController.UpdateLaunchNumberUI(currentLaunchChance);
    }
Пример #8
0
        public static WpfColor[] GenerateWpfColors(this ColorPalettes palette, Int32 length)
        {
            var colors      = palette.GenerateOxyColors(length);
            var transformed = new WpfColor[colors.Length];

            for (int i = 0; i < colors.Length; i++)
            {
                var color = colors[i];
                transformed[i] = new WpfColor
                {
                    A = color.A,
                    R = color.R,
                    G = color.G,
                    B = color.B,
                };
            }

            return(transformed);
        }
Пример #9
0
        public ContourViewModel(ContourPlotValue value)
        {
            _value        = value;
            _title        = value[0].Label;
            _colorPalette = value.ColorPalette;
            _showLevels   = value.ShowLevel;
            _save         = new RelayCommand(x =>
            {
                var window          = x as Window;
                _value.ColorPalette = _colorPalette;
                _value[0].Label     = _title;
                _value.ShowLevel    = _showLevels;
                _value.UpdateProperties();

                if (window != null)
                {
                    window.Close();
                }
            });
        }
    private void InitializeChart()
    {
      this.tChart1.Aspect.GestureOptions = Steema.TeeChart.Store.Drawing.Aspect.Gestures.None;
      this.tChart1.Series.Add(gantt1);
      this.tChart1.Aspect.View3D = false;
      this.tChart1.Axes.Bottom.Increment = 30D;
      this.tChart1.Axes.Bottom.Labels.Font.Brush.Color = Colors.Gray;
      this.tChart1.Axes.Bottom.Labels.Font.Size = 16;
      this.tChart1.Axes.Bottom.Title.Caption = "Time";
      this.tChart1.Axes.Bottom.Title.Font.Brush.Color = Colors.Gray;
      this.tChart1.Axes.Bottom.Title.Font.Name = "Segoe UI";
      this.tChart1.Axes.Bottom.Title.Lines = new string[] {
        "Time"};
      this.tChart1.Axes.Left.AxisPen.Visible = false;
      this.tChart1.Axes.Left.Labels.Font.Brush.Color = Colors.Gray;
      this.tChart1.Axes.Left.Labels.Font.Size = 13;
      this.tChart1.Axes.Left.MinorTicks.Visible = false;
      this.tChart1.Axes.Left.Title.Caption = "Task";
      this.tChart1.Axes.Left.Title.Font.Brush.Color = Colors.Gray;
      this.tChart1.Axes.Left.Title.Font.Name = "Segoe UI";
      this.tChart1.Axes.Left.Title.Lines = new string[] {
        "Task"};
      this.tChart1.Footer.Font.Brush.Color = Colors.Blue;
      this.tChart1.Header.Font.Brush.Color = Colors.Gray;
      this.tChart1.Header.Font.Size = 21;
      this.tChart1.Header.Lines = new string[] {
        "Project Planner"};
      this.tChart1.Legend.Visible = false;
      this.tChart1.Name = "tChart1";
      this.tChart1.Panel.Brush.Color = Colors.White;
      this.tChart1.Panel.Brush.Gradient.EndColor = Colors.White;
      this.tChart1.Series.Add(this.gantt1);
      this.tChart1.TabIndex = 0;
      this.tChart1.Walls.Back.Brush.Gradient.EndColor = Colors.White;
      this.tChart1.Walls.Back.Visible = false;
      this.gantt1.Color = Color.FromArgb(255, ((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
      this.gantt1.ColorEach = true;
      this.gantt1.EndValues.DataMember = "End";
      this.gantt1.EndValues.DateTime = true;
      this.gantt1.LabelMember = "Labels";
      this.gantt1.LinePen.Color = Color.FromArgb(255, ((int)(((byte)(41)))), ((int)(((byte)(61)))), ((int)(((byte)(98)))));
      this.gantt1.Marks.Brush.Visible = false;
      this.gantt1.Marks.Transparent = true;
      this.gantt1.Marks.Visible = true;
      this.gantt1.OriginalCursor = null;
      this.gantt1.Pointer.Brush.ForegroundColor = Utils.EmptyColor;
      this.gantt1.Pointer.Brush.Gradient.StartColor = Color.FromArgb(255, ((int)(((byte)(68)))), ((int)(((byte)(102)))), ((int)(((byte)(163)))));
      this.gantt1.Pointer.Pen.Visible = false;
      this.gantt1.Pointer.SizeDouble = 0D;
      this.gantt1.Pointer.SizeUnits = PointerSizeUnits.Pixels;
      this.gantt1.StartValues.DataMember = "Start";
      this.gantt1.StartValues.DateTime = true;
      this.gantt1.StartValues.Order = ValueListOrder.Ascending;
      this.gantt1.Title = "gantt1";
      this.gantt1.YValues.DataMember = "Y";

      tChart1.Panel.Gradient.Visible = false;

      gantt1.Add(new DateTime(2014, 6, 7), new DateTime(2014, 9, 23), 0, "Production");
      gantt1.Add(new DateTime(2014, 9, 3), new DateTime(2014, 11, 10), 1, "Marketing");
      gantt1.Add(new DateTime(2014, 3, 13), new DateTime(2014, 3, 31), 2, "Approve");
      gantt1.Add(new DateTime(2014, 5, 7), new DateTime(2014, 6, 5), 3, "Prototype");
      gantt1.Add(new DateTime(2014, 10, 11), new DateTime(2014, 11, 5), 4, "Evaluation");
      gantt1.Add(new DateTime(2014, 4, 2), new DateTime(2014, 4, 29), 5, "Design");

      gantt1.AddMultipleNextTasks(2, 4);
      gantt1.AddMultipleNextTasks(2, 3);

      gantt1.ConnectingPen.Color = Color.FromArgb(255, 49, 44, 59);
      gantt1.ConnectingPen.Width = 2;

      gantt1.Pointer.Style = PointerStyles.Rectangle;
      gantt1.Pointer.VertSize = 25;
      gantt1.GetSeriesMark += Gantt1_GetSeriesMark;

      ColorPalettes.ApplyPalette(tChart1.Chart, 21);
    }
 private void ChartPalettes_Leave(object sender, System.EventArgs e)
 {
     ColorPalettes.ApplyPalette(tChart1.Chart, Steema.TeeChart.Themes.Theme.OperaPalette);
 }
 private void cbDefault_SelectedIndexChanged(object sender, System.EventArgs e)
 {
     ColorPalettes.ApplyPalette(tChart1.Chart, cbDefault.SelectedIndex);
 }