Add xmldocs

This commit is contained in:
smoogipoo 2020-08-22 00:52:53 +09:00
parent 9fbc5f3aeb
commit f89b6f4465
1 changed files with 15 additions and 0 deletions

View File

@ -63,6 +63,11 @@ IEnumerable<Texture> getTextures()
} }
} }
/// <summary>
/// The resultant colour after setting a post-constructor colour in osu!stable.
/// </summary>
/// <param name="colour">The <see cref="Color4"/> to convert.</param>
/// <returns>The converted <see cref="Color4"/>.</returns>
public static Color4 ToLegacyColour(this Color4 colour) public static Color4 ToLegacyColour(this Color4 colour)
{ {
if (colour.A == 0) if (colour.A == 0)
@ -70,6 +75,16 @@ public static Color4 ToLegacyColour(this Color4 colour)
return colour; return colour;
} }
/// <summary>
/// Equivalent of setting a colour in the constructor in osu!stable.
/// Doubles the alpha channel into <see cref="Drawable.Alpha"/> and uses <see cref="ToLegacyColour"/> to set <see cref="Drawable.Colour"/>.
/// </summary>
/// <remarks>
/// Beware: Any existing value in <see cref="Drawable.Alpha"/> is overwritten.
/// </remarks>
/// <param name="drawable">The <see cref="Drawable"/> to set the "InitialColour" of.</param>
/// <param name="colour">The <see cref="Color4"/> to set.</param>
/// <returns>The given <see cref="Drawable"/>.</returns>
public static T WithInitialColour<T>(this T drawable, Color4 colour) public static T WithInitialColour<T>(this T drawable, Color4 colour)
where T : Drawable where T : Drawable
{ {