You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ColorExtensions: scale alpha, and blend toward a backdrop in the active color space #1295
ButtonGlyphDrawer.Faded(Color color, float opacity, Color backdrop): Color.Lerp(backdrop, color, opacity), done on .linear values and converted back with .gamma when QualitySettings.activeColorSpace is Linear, keeping color.a.
A third copy of the first landed in a parallel change the same day, which is the duplication this ask would end. Found by DoxReloaded PR #1302's lint for general-purpose code.
Ask
In Core/Extension/ColorExtensions.cs:
Color WithAlpha(this Color color, float alpha) and Color ScaleAlpha(this Color color, float factor).
Color BlendOver(this Color color, Color backdrop, float opacity), which lerps in linear space when the project's active color space is Linear and keeps color.a.
Evidence
3.7.2's ColorExtensions has ToHex, GetAverageColor and GetComplement, and no alpha or blend helper.
Activity