天天看點

ColorHelper

public static class ColorHelper {


        /// <summary>
        /// Get contrasting color according to target color.
        /// </summary>
        /// <param name="targetColor">Target color</param>
        /// <returns>Contrasting color</returns>
        public static Color GetContrastingColor(Color targetColor) {
            return Color.FromArgb(255 - targetColor.R, 255 - targetColor.G, 255 - targetColor.B);
        }
    }