Example #1
0
        public ColorPickerForm(Color currentColor, bool isScreenColorPickerMode = false, bool checkClipboard = true, ColorPickerOptions options = null)
        {
            InitializeComponent();
            ShareXResources.ApplyTheme(this);
            clipboardStatusHider = new ControlHider(btnClipboardStatus, 2000);

            IsScreenColorPickerMode = isScreenColorPickerMode;
            Options = options;

            if (Options == null)
            {
                Options = new ColorPickerOptions();
            }

            if (Options.RecentColorsSelected)
            {
                rbRecentColors.Checked = true;
            }
            else
            {
                rbStandardColors.Checked = true;
            }

            PrepareColorPalette();
            SetCurrentColor(currentColor, !IsScreenColorPickerMode);

            if (checkClipboard)
            {
                CheckClipboard();
            }

            btnOK.Visible  = btnCancel.Visible = !IsScreenColorPickerMode;
            mbCopy.Visible = btnClose.Visible = pCursorPosition.Visible = IsScreenColorPickerMode;
        }
Example #2
0
        public ColorPickerForm(Color currentColor, bool isScreenColorPickerMode = false, bool checkClipboard = true)
        {
            InitializeComponent();
            ShareXResources.ApplyTheme(this);
            clipboardStatusHider = new ControlHider(btnClipboardStatus, 2000);

            IsScreenColorPickerMode = isScreenColorPickerMode;

            PrepareColorPalette();
            SetCurrentColor(currentColor, !IsScreenColorPickerMode);

            if (checkClipboard)
            {
                CheckClipboard();
            }

            btnOK.Visible  = btnCancel.Visible = !IsScreenColorPickerMode;
            mbCopy.Visible = btnClose.Visible = pCursorPosition.Visible = IsScreenColorPickerMode;
        }