/// <summary> /// Saturates the color by the provided percentage amount. /// </summary> /// <param name="input">The input.</param> /// <param name="amount">The amount.</param> /// <returns></returns> public static string Saturate(string input, string amount) { var color = new RockColor(input); color.Saturate(CleanColorAmount(amount)); // return the color in a format that matched the input if (input.StartsWith("#")) { return(color.ToHex()); } return(color.ToRGBA()); }
/// <summary> /// Determines the proper return value of the color. /// </summary> /// <param name="color">The color.</param> /// <param name="input">The input.</param> /// <returns></returns> private static string GetColorString(RockColor color, string input) { if (color.Alpha != 1) { return(color.ToRGBA()); } if (input.StartsWith("#")) { return(color.ToHex()); } return(color.ToRGBA()); }