Example #1
0
        private void SelectColor(ref int intR, ref int intG, ref int intB)
        {
            TextBox tbR = new TextBox();
            TextBox tbG = new TextBox();
            TextBox tbB = new TextBox();

            tbR.Text = "" + intR;
            tbG.Text = "" + intG;
            tbB.Text = "" + intB;

            // sync > @ _WindRect_SelectColorDlg

            try
            {
                int[] defColors = new int[16];

                for (int index = 0; index < 16; index++)
                {
                    defColors[index] = index * 0x081008 + 0x800000;
                }

                Color color;

                {
                    int r = int.Parse(tbR.Text) & 0xff;
                    int g = int.Parse(tbG.Text) & 0xff;
                    int b = int.Parse(tbB.Text) & 0xff;

                    color = Color.FromArgb(r, g, b);
                }

                if (SaveLoadDialogs.SelectColor(ref color, defColors))
                {
                    int r = color.R;
                    int g = color.G;
                    int b = color.B;

                    tbR.Text = "" + r;
                    tbG.Text = "" + g;
                    tbB.Text = "" + b;
                }
            }
            catch
            { }

            // < sync

            intR = int.Parse(tbR.Text);
            intG = int.Parse(tbG.Text);
            intB = int.Parse(tbB.Text);

            this.SomethingModified = true;
        }
Example #2
0
        private void 色Btn_Click(object sender, EventArgs e)
        {
            TextBox tbR = this.ColorRText;
            TextBox tbG = this.ColorGText;
            TextBox tbB = this.ColorBText;

            // sync > @ _WindRect_SelectColorDlg

            try
            {
                int[] defColors = new int[16];

                for (int index = 0; index < 16; index++)
                {
                    defColors[index] = index * 0x081008 + 0x800000;
                }

                Color color;

                {
                    int r = int.Parse(tbR.Text) & 0xff;
                    int g = int.Parse(tbG.Text) & 0xff;
                    int b = int.Parse(tbB.Text) & 0xff;

                    color = Color.FromArgb(r, g, b);
                }

                if (SaveLoadDialogs.SelectColor(ref color, defColors))
                {
                    int r = color.R;
                    int g = color.G;
                    int b = color.B;

                    tbR.Text = "" + r;
                    tbG.Text = "" + g;
                    tbB.Text = "" + b;
                }
            }
            catch
            { }

            // < sync
        }