public ColorPickerWindow(Color color)
 {
     InitializeComponent();
     ColorPickerControl.SetColor(color);
     Transfer.SelectedColor = color;
     OKButton.Focus();
 }
Exemplo n.º 2
0
            public void Init(Color color, string name)
            {
                RedSlider   = new Slider("Red", color.R, 0, 255);
                GreenSlider = new Slider("Green", color.B, 0, 255);
                BlueSlider  = new Slider("Blue", color.G, 0, 255);
                ColorPicker = new ColorPickerControl(Id + "ColorDisplay", color);

                _menu.AddGroupLabel(name);

                _menu.Add(Id + "ColorDisplay", ColorPicker);
                _menu.Add(Id + "Red", RedSlider);
                _menu.Add(Id + "Green", GreenSlider);
                _menu.Add(Id + "Blue", BlueSlider);

                RedSlider.OnValueChange   += OnValueChange;
                GreenSlider.OnValueChange += OnValueChange;
                BlueSlider.OnValueChange  += OnValueChange;

                ColorPicker.SetColor(Color.FromArgb(GetValue(ColorBytes.Red), GetValue(ColorBytes.Green), GetValue(ColorBytes.Blue)));
            }
Exemplo n.º 3
0
        public void Init(Color color, string name)
        {
            AlphaSlider = new Slider("Alpha", color.A, 0, 255);
            RedSlider   = new Slider("Kirmisi", color.R, 0, 255);
            GreenSlider = new Slider("Yesil", color.B, 0, 255);
            BlueSlider  = new Slider("Mavi", color.G, 0, 255);
            Picker      = new ColorPickerControl(Id + "ColorDisplay", color);

            _menu.AddLabel(name);

            _menu.Add(Id + "ColorDisplay", Picker);
            _menu.Add(Id + "Alpha", AlphaSlider);
            _menu.Add(Id + "Red", RedSlider);
            _menu.Add(Id + "Green", GreenSlider);
            _menu.Add(Id + "Blue", BlueSlider);

            AlphaSlider.OnValueChange += OnValueChange;
            RedSlider.OnValueChange   += OnValueChange;
            GreenSlider.OnValueChange += OnValueChange;
            BlueSlider.OnValueChange  += OnValueChange;

            Picker.SetColor(Color.FromArgb(GetValue(ColorBytes.Alpha), GetValue(ColorBytes.Red),
                                           GetValue(ColorBytes.Green), GetValue(ColorBytes.Blue)));
        }