Пример #1
0
        private void UpdateUI()
        {
            if (GetPaletteColourDefinition() == BasicPaletteColourDefinitions.BASECOLOUR)
            {
                ktbHexadecimal.Text = _conversionMethods.ConvertRGBToHexadecimal(Convert.ToInt32(knumRedChannelValue.Value), Convert.ToInt32(knumGreenChannelValue.Value), Convert.ToInt32(knumBlueChannelValue.Value)).ToUpper();

                cpbBaseColourPreview.BackColor = Color.FromArgb(Convert.ToInt32(knumAlphaChannelValue.Value), Convert.ToInt32(knumRedChannelValue.Value), Convert.ToInt32(knumGreenChannelValue.Value), Convert.ToInt32(knumBlueChannelValue.Value));
            }
            else if (GetPaletteColourDefinition() == BasicPaletteColourDefinitions.DARKESTCOLOUR)
            {
                ktbHexadecimal.Text = _conversionMethods.ConvertRGBToHexadecimal(Convert.ToInt32(knumRedChannelValue.Value), Convert.ToInt32(knumGreenChannelValue.Value), Convert.ToInt32(knumBlueChannelValue.Value)).ToUpper();

                cpbDarkestColourPreview.BackColor = Color.FromArgb(Convert.ToInt32(knumAlphaChannelValue.Value), Convert.ToInt32(knumRedChannelValue.Value), Convert.ToInt32(knumGreenChannelValue.Value), Convert.ToInt32(knumBlueChannelValue.Value));
            }
            else if (GetPaletteColourDefinition() == BasicPaletteColourDefinitions.MIDDLECOLOUR)
            {
                ktbHexadecimal.Text = _conversionMethods.ConvertRGBToHexadecimal(Convert.ToInt32(knumRedChannelValue.Value), Convert.ToInt32(knumGreenChannelValue.Value), Convert.ToInt32(knumBlueChannelValue.Value)).ToUpper();

                cpbMiddleColourPreview.BackColor = Color.FromArgb(Convert.ToInt32(knumAlphaChannelValue.Value), Convert.ToInt32(knumRedChannelValue.Value), Convert.ToInt32(knumGreenChannelValue.Value), Convert.ToInt32(knumBlueChannelValue.Value));
            }
            else if (GetPaletteColourDefinition() == BasicPaletteColourDefinitions.LIGHTCOLOUR)
            {
                ktbHexadecimal.Text = _conversionMethods.ConvertRGBToHexadecimal(Convert.ToInt32(knumRedChannelValue.Value), Convert.ToInt32(knumGreenChannelValue.Value), Convert.ToInt32(knumBlueChannelValue.Value)).ToUpper();

                cpbLightColourPreview.BackColor = Color.FromArgb(Convert.ToInt32(knumAlphaChannelValue.Value), Convert.ToInt32(knumRedChannelValue.Value), Convert.ToInt32(knumGreenChannelValue.Value), Convert.ToInt32(knumBlueChannelValue.Value));
            }
            else if (GetPaletteColourDefinition() == BasicPaletteColourDefinitions.LIGHTESTCOLOUR)
            {
                ktbHexadecimal.Text = _conversionMethods.ConvertRGBToHexadecimal(Convert.ToInt32(knumRedChannelValue.Value), Convert.ToInt32(knumGreenChannelValue.Value), Convert.ToInt32(knumBlueChannelValue.Value)).ToUpper();

                cpbLightestColourPreview.BackColor = Color.FromArgb(Convert.ToInt32(knumAlphaChannelValue.Value), Convert.ToInt32(knumRedChannelValue.Value), Convert.ToInt32(knumGreenChannelValue.Value), Convert.ToInt32(knumBlueChannelValue.Value));
            }
        }
Пример #2
0
        private void UpdateUI()
        {
            klblHexOutput.Text = $"Hex Value: #{ conversionMethods.ConvertRGBToHexadecimal(conversionMethods.ConvertDecimalToInteger(numRed.Value), conversionMethods.ConvertDecimalToInteger(numGreen.Value), conversionMethods.ConvertDecimalToInteger(numBlue.Value)).ToUpper() }";

            pnlPreview.BackColor = Color.FromArgb(conversionMethods.ConvertDecimalToInteger(numRed.Value), conversionMethods.ConvertDecimalToInteger(numGreen.Value), conversionMethods.ConvertDecimalToInteger(numBlue.Value));

            klblAlpha.Enabled = GetEnableAlphaChannel();

            numAlpha.Enabled = GetEnableAlphaChannel();
        }
 private void SetHexadecimalValue()
 {
     ktxtHexValue.Text = _conversionMethods.ConvertRGBToHexadecimal(GetRedColourChannelValue(), GetGreenColourChannelValue(), GetBlueColourChannelValue()).ToUpper(); //DeciamlToHexadeciaml(Convert.ToInt32(knumRedChannelValue.Value + knumGreenChannelValue.Value + knumBlueChannelValue.Value));
 }
Пример #4
0
 private void pbxBaseColour_MouseEnter(object sender, EventArgs e)
 {
     ttInformation.SetToolTip(pbxBaseColour, $"Base Colour\nARGB: ({ pbxBaseColour.BackColor.A.ToString() }, { pbxBaseColour.BackColor.R.ToString() }, { pbxBaseColour.BackColor.G.ToString() }, { pbxBaseColour.BackColor.B.ToString() })\nRGB: ({ pbxBaseColour.BackColor.R.ToString() }, { pbxBaseColour.BackColor.G.ToString() }, { pbxBaseColour.BackColor.B.ToString() })\nHexadecimal Value: #{ _conversionMethods.ConvertRGBToHexadecimal(Convert.ToInt32(pbxBaseColour.BackColor.R), Convert.ToInt32(pbxBaseColour.BackColor.G), Convert.ToInt32(pbxBaseColour.BackColor.B)).ToUpper() }");
 }
 private void pbxBaseColour_MouseEnter(object sender, EventArgs e)
 {
     _toolTipManager.DisplayToolTip(ttInformation, pbxBaseColour, "Base", pbxBaseColour.BackColor.A, pbxBaseColour.BackColor.R, pbxBaseColour.BackColor.G, pbxBaseColour.BackColor.B, _conversionMethods.ConvertRGBToHexadecimal(pbxBaseColour.BackColor.R, pbxBaseColour.BackColor.G, pbxBaseColour.BackColor.B), 0);
 }