mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-29 23:58:34 +01:00
Added ColorExtensions.Invert and made ColorHelper.Invert obsolete
This commit is contained in:
parent
6aa9ec03d4
commit
a52b46dce9
2 changed files with 13 additions and 6 deletions
|
@ -14,6 +14,7 @@ Improvements
|
||||||
- Improved NinePatch memory performance
|
- Improved NinePatch memory performance
|
||||||
- Moved sound-related classes into Sound namespace
|
- Moved sound-related classes into Sound namespace
|
||||||
- Added customizable overloads for Keybind, Combination and GenericInput ToString methods
|
- Added customizable overloads for Keybind, Combination and GenericInput ToString methods
|
||||||
|
- Added ColorExtensions.Invert and made ColorHelper.Invert obsolete
|
||||||
|
|
||||||
Fixes
|
Fixes
|
||||||
- Set default values for InputHandler held and pressed keys to avoid an exception if buttons are held in the very first frame
|
- Set default values for InputHandler held and pressed keys to avoid an exception if buttons are held in the very first frame
|
||||||
|
|
|
@ -18,6 +18,15 @@ namespace MLEM.Extensions {
|
||||||
return color * (other.A / 255F);
|
return color * (other.A / 255F);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns an inverted version of this color.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="color">The color to invert</param>
|
||||||
|
/// <returns>The inverted color</returns>
|
||||||
|
public static Color Invert(this Color color) {
|
||||||
|
return new Color(Math.Abs(255 - color.R), Math.Abs(255 - color.G), Math.Abs(255 - color.B), color.A);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -25,13 +34,10 @@ namespace MLEM.Extensions {
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static class ColorHelper {
|
public static class ColorHelper {
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc cref="ColorExtensions.Invert"/>
|
||||||
/// Returns an inverted version of the color.
|
[Obsolete("This method has been moved to ColorExtensions.Invert")]
|
||||||
/// </summary>
|
|
||||||
/// <param name="color">The color to invert</param>
|
|
||||||
/// <returns>The inverted color</returns>
|
|
||||||
public static Color Invert(this Color color) {
|
public static Color Invert(this Color color) {
|
||||||
return new Color(Math.Abs(255 - color.R), Math.Abs(255 - color.G), Math.Abs(255 - color.B), color.A);
|
return ColorExtensions.Invert(color);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
Loading…
Reference in a new issue