/// <summary> /// /// </summary> /// <param name="baseColour"></param> /// <param name="darkestColour"></param> /// <param name="mediumColour"></param> /// <param name="lightColour"></param> /// <param name="lightestColour"></param> public static void SetBasicPaletteColours(CircularPictureBox baseColour, CircularPictureBox darkestColour, CircularPictureBox mediumColour, CircularPictureBox lightColour, CircularPictureBox lightestColour) { BasicColourSettingsManager basicPaletteColourManager = new BasicColourSettingsManager(); try { if (!BasicColourSettingsManager.AreBasicPaletteColoursEmpty()) { basicPaletteColourManager.ResetToDefaults(); basicPaletteColourManager.SetBaseColour(baseColour.BackColor); basicPaletteColourManager.SetDarkColour(darkestColour.BackColor); basicPaletteColourManager.SetMediumColour(mediumColour.BackColor); basicPaletteColourManager.SetLightColour(lightColour.BackColor); basicPaletteColourManager.SetLightestColour(lightestColour.BackColor); basicPaletteColourManager.SaveBasicColourSettings(); } else { basicPaletteColourManager.SetBaseColour(baseColour.BackColor); basicPaletteColourManager.SetDarkColour(darkestColour.BackColor); basicPaletteColourManager.SetMediumColour(mediumColour.BackColor); basicPaletteColourManager.SetLightColour(lightColour.BackColor); basicPaletteColourManager.SetLightestColour(lightestColour.BackColor); basicPaletteColourManager.SaveBasicColourSettings(); } } catch (Exception exc) { KryptonMessageBox.Show($"An unexpected error has occurred: { exc.Message }", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); basicPaletteColourManager.ResetToDefaults(); } }
/// <summary> /// Displays the tool tip. /// </summary> /// <param name="information">The information.</param> /// <param name="target">The target.</param> /// <param name="colourType">Type of the colour.</param> /// <param name="alphaValue">The alpha value.</param> /// <param name="redValue">The red value.</param> /// <param name="greenValue">The green value.</param> /// <param name="blueValue">The blue value.</param> /// <param name="hexValue">The hexadecimal value.</param> /// <param name="hueValue">The hue value.</param> public static void DisplayToolTip(ToolTip information, CircularPictureBox target, string colourType, int alphaValue, int redValue, int greenValue, int blueValue, string hexValue, double hueValue) { information.SetToolTip(target, $"{ colourType } Colour\nARGB: ({ alphaValue.ToString() }, { redValue.ToString() }, { greenValue.ToString() }, { blueValue.ToString() })\nRGB: ({ redValue.ToString() }, { greenValue.ToString() }, { blueValue.ToString() })\nHexadecimal Value: #{ hexValue.ToUpper() }\nHue Value: { hueValue.ToString() }"); }