コード例 #1
0
 public ColorPickerWindow(Color color)
 {
     InitializeComponent();
     ColorPickerControl.SetColor(color);
     Transfer.SelectedColor = color;
     OKButton.Focus();
 }
コード例 #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)));
            }
コード例 #3
0
ファイル: ColorPicker.cs プロジェクト: tekintr/Elobuddy
        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)));
        }