using System.Runtime.CompilerServices; using UnityEngine; namespace Boxfriend.Extensions { public static class StringExtensions { /// /// Checks if two strings are the same without case sensitivity. /// /// String being compared [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool CaseInsensitveEquals (this string str, string value) => (str.ToLower() == value.ToLower()); /// /// Applies a rich text color to string /// /// String to be colored /// Unity Color applied to all of 'text' public static string AddColor(this string text, Color col) => $"{text}"; public static string ColorHexFromUnityColor(this Color unityColor) => $"#{ColorUtility.ToHtmlStringRGBA(unityColor)}"; } }