using System.Diagnostics.Contracts; using System.Runtime.CompilerServices; using UnityEngine; namespace X10D.Unity.Drawing; /// /// Drawing-related extensions for . /// public static class Color32Extensions { /// /// Returns a new with the red, green, and blue components inverted. Alpha is not affected. /// /// The color to invert. /// The inverted color. [Pure] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Color32 Inverted(this Color32 color) { return new Color32((byte)(255 - color.r), (byte)(255 - color.g), (byte)(255 - color.b), color.a); } }