예제 #1
0
        private void kbtnConvertToRGB_Click(object sender, EventArgs e)
        {
            TargetColour = ColorTranslator.FromHtml($"#{ ktxtHexValue.Text }");

            klbColours.Items.Add(ColourFormatting.FormatColourAsRGBString(TargetColour));

            TargetColour = Color.Transparent;

            Modified = true;

            ktxtHexValue.Text = "";

            kbtnConvertToRGB.Enabled = false;

            ktxtHexValue.Focus();
        }
        public static void SetColourSettingsAsString(AllAvailableColourTypes colourType, Color colour)
        {
            ColourStringSettingsManager colourStringSettingsManager = new ColourStringSettingsManager();

            switch (colourType)
            {
            case AllAvailableColourTypes.ALTERNATIVENORMALTEXTCOLOUR:
                colourStringSettingsManager.SetAlternativeNormalTextColour(ColourFormatting.FormatColourAsString(colour));
                break;

            case AllAvailableColourTypes.BASECOLOUR:
                colourStringSettingsManager.SetBaseColour(ColourFormatting.FormatColourAsString(colour));
                break;

            case AllAvailableColourTypes.BORDERCOLOUR:
                colourStringSettingsManager.SetBorderColour(ColourFormatting.FormatColourAsString(colour));
                break;

            case AllAvailableColourTypes.CUSTOMCOLOURONE:
                colourStringSettingsManager.SetCustomColourOne(ColourFormatting.FormatColourAsString(colour));
                break;

            case AllAvailableColourTypes.CUSTOMCOLOURTWO:
                colourStringSettingsManager.SetCustomColourTwo(ColourFormatting.FormatColourAsString(colour));
                break;

            case AllAvailableColourTypes.CUSTOMCOLOURTHREE:
                colourStringSettingsManager.SetCustomColourThree(ColourFormatting.FormatColourAsString(colour));
                break;

            case AllAvailableColourTypes.CUSTOMCOLOURFOUR:
                colourStringSettingsManager.SetCustomColourFour(ColourFormatting.FormatColourAsString(colour));
                break;

            case AllAvailableColourTypes.CUSTOMCOLOURFIVE:
                colourStringSettingsManager.SetCustomColourFive(ColourFormatting.FormatColourAsString(colour));
                break;

            case AllAvailableColourTypes.CUSTOMCOLOURSIX:
                colourStringSettingsManager.SetCustomColourSix(ColourFormatting.FormatColourAsRGBString(colour));
                break;

            case AllAvailableColourTypes.CUSTOMTEXTCOLOURONE:
                colourStringSettingsManager.SetCustomTextColourOne(ColourFormatting.FormatColourAsString(colour));
                break;

            case AllAvailableColourTypes.CUSTOMTEXTCOLOURTWO:
                colourStringSettingsManager.SetCustomTextColourTwo(ColourFormatting.FormatColourAsString(colour));
                break;

            case AllAvailableColourTypes.CUSTOMTEXTCOLOURTHREE:
                colourStringSettingsManager.SetCustomTextColourThree(ColourFormatting.FormatColourAsString(colour));
                break;

            case AllAvailableColourTypes.CUSTOMTEXTCOLOURFOUR:
                colourStringSettingsManager.SetCustomTextColourFour(ColourFormatting.FormatColourAsString(colour));
                break;

            case AllAvailableColourTypes.CUSTOMTEXTCOLOURFIVE:
                colourStringSettingsManager.SetCustomTextColourFive(ColourFormatting.FormatColourAsString(colour));
                break;

            case AllAvailableColourTypes.CUSTOMTEXTCOLOURSIX:
                colourStringSettingsManager.SetCustomTextColourSix(ColourFormatting.FormatColourAsRGBString(colour));
                break;

            case AllAvailableColourTypes.DARKESTCOLOUR:
                colourStringSettingsManager.SetDarkestColour(ColourFormatting.FormatColourAsString(colour));
                break;

            case AllAvailableColourTypes.DISABLEDCONTROLCOLOUR:
                colourStringSettingsManager.SetDisabledColour(ColourFormatting.FormatColourAsString(colour));
                break;

            case AllAvailableColourTypes.DISABLEDTEXTCOLOUR:
                colourStringSettingsManager.SetDisabledTextColour(ColourFormatting.FormatColourAsString(colour));
                break;

            case AllAvailableColourTypes.FOCUSEDTEXTCOLOUR:
                colourStringSettingsManager.SetFocusedTextColour(ColourFormatting.FormatColourAsString(colour));
                break;

            case AllAvailableColourTypes.LIGHTCOLOUR:
                colourStringSettingsManager.SetLightColour(ColourFormatting.FormatColourAsString(colour));
                break;

            case AllAvailableColourTypes.LIGHTESTCOLOUR:
                colourStringSettingsManager.SetLightestColour(ColourFormatting.FormatColourAsString(colour));
                break;

            case AllAvailableColourTypes.LINKDISABLEDCOLOUR:
                colourStringSettingsManager.SetLinkDisabledColour(ColourFormatting.FormatColourAsString(colour));
                break;

            case AllAvailableColourTypes.LINKHOVERCOLOUR:
                colourStringSettingsManager.SetLinkHoverColour(ColourFormatting.FormatColourAsString(colour));
                break;

            case AllAvailableColourTypes.LINKNORMALCOLOUR:
                colourStringSettingsManager.SetLinkNormalColour(ColourFormatting.FormatColourAsString(colour));
                break;

            case AllAvailableColourTypes.LINKVISITEDCOLOUR:
                colourStringSettingsManager.SetLinkVisitedColour(ColourFormatting.FormatColourAsString(colour));
                break;

            case AllAvailableColourTypes.MEDIUMCOLOUR:
                colourStringSettingsManager.SetMediumColour(ColourFormatting.FormatColourAsString(colour));
                break;

            case AllAvailableColourTypes.MENUTEXTCOLOUR:
                colourStringSettingsManager.SetMenuTextColour(ColourFormatting.FormatColourAsString(colour));
                break;

            case AllAvailableColourTypes.NORMALTEXTCOLOUR:
                colourStringSettingsManager.SetNormalTextColour(ColourFormatting.FormatColourAsString(colour));
                break;

            case AllAvailableColourTypes.PRESSEDTEXTCOLOUR:
                colourStringSettingsManager.SetPressedTextColour(ColourFormatting.FormatColourAsString(colour));
                break;

            case AllAvailableColourTypes.STATUSTEXTCOLOUR:
                colourStringSettingsManager.SetStatusTextColour(ColourFormatting.FormatColourAsString(colour));
                break;

            default:
                break;
            }
        }