Problem
The four static component-accessor methods (GetAlphaComponent, GetRedComponent, GetGreenComponent, GetBlueComponent) on the Android.Graphics.Color struct have no XML documentation. These public helpers extract a single channel from a packed ARGB color integer and are the static counterparts to the A/R/G/B instance properties that were documented in #11581. Without docs, IntelliSense gives no hint about the expected color argument or the 0–255 return range.
Location
- File(s):
src/Mono.Android/Android.Graphics/Color.cs
- Line(s): 152–170 (the
#region Public Static Methods block)
Current Code
#region Public Static Methods
public static int GetAlphaComponent (int color)
{
return (byte)(color >> 24);
}
public static int GetBlueComponent (int color)
{
return (byte)color;
}
public static int GetGreenComponent (int color)
{
return (byte)(color >> 8);
}
public static int GetRedComponent (int color)
{
return (byte)(color >> 16);
}
Suggested Fix
Add <summary>, <param>, and <returns> XML doc comments to each of the four methods, mirroring the style used for the A/B/G/R properties in #11581. Do not change any method bodies:
#region Public Static Methods
/// <summary>
/// Extracts the alpha (opacity) component from a packed ARGB color integer, where 0 is fully transparent and 255 is fully opaque.
/// </summary>
/// <param name="color">A packed ARGB color integer, such as the value returned by <see cref="ToArgb"/>.</param>
/// <returns>The alpha component of <paramref name="color"/>, in the range 0–255.</returns>
public static int GetAlphaComponent (int color)
{
return (byte)(color >> 24);
}
/// <summary>
/// Extracts the blue component from a packed ARGB color integer.
/// </summary>
/// <param name="color">A packed ARGB color integer, such as the value returned by <see cref="ToArgb"/>.</param>
/// <returns>The blue component of <paramref name="color"/>, in the range 0–255.</returns>
public static int GetBlueComponent (int color)
{
return (byte)color;
}
/// <summary>
/// Extracts the green component from a packed ARGB color integer.
/// </summary>
/// <param name="color">A packed ARGB color integer, such as the value returned by <see cref="ToArgb"/>.</param>
/// <returns>The green component of <paramref name="color"/>, in the range 0–255.</returns>
public static int GetGreenComponent (int color)
{
return (byte)(color >> 8);
}
/// <summary>
/// Extracts the red component from a packed ARGB color integer.
/// </summary>
/// <param name="color">A packed ARGB color integer, such as the value returned by <see cref="ToArgb"/>.</param>
/// <returns>The red component of <paramref name="color"/>, in the range 0–255.</returns>
public static int GetRedComponent (int color)
{
return (byte)(color >> 16);
}
Guidelines
- Use tabs for indentation (Mono style per
.editorconfig).
- Keep the existing
#region / #endregion markers in place.
- Do not modify any code logic — only add XML doc comments.
- Do not touch the
Argb/Rgb factory methods, the named color properties, or any other members in this file.
- Ensure every
<see cref="..."/> resolves (e.g. ToArgb) so no CS1574 warnings are introduced.
Acceptance Criteria
Fix-finder metadata
- Script:
04-missing-xml-docs
- Score:
30/30 (actionability: 10, safety: 10, scope: 10)
Generated by Nightly Fix Finder · 689.6 AIC · ⌖ 68.9 AIC · ⊞ 40.4K · ◷
Problem
The four static component-accessor methods (
GetAlphaComponent,GetRedComponent,GetGreenComponent,GetBlueComponent) on theAndroid.Graphics.Colorstruct have no XML documentation. These public helpers extract a single channel from a packed ARGB color integer and are the static counterparts to theA/R/G/Binstance properties that were documented in #11581. Without docs, IntelliSense gives no hint about the expectedcolorargument or the0–255return range.Location
src/Mono.Android/Android.Graphics/Color.cs#region Public Static Methodsblock)Current Code
Suggested Fix
Add
<summary>,<param>, and<returns>XML doc comments to each of the four methods, mirroring the style used for theA/B/G/Rproperties in #11581. Do not change any method bodies:Guidelines
.editorconfig).#region/#endregionmarkers in place.Argb/Rgbfactory methods, the named color properties, or any other members in this file.<see cref="..."/>resolves (e.g.ToArgb) so noCS1574warnings are introduced.Acceptance Criteria
GetAlphaComponent,GetBlueComponent,GetGreenComponent,GetRedComponent) has<summary>,<param>, and<returns>XML doc comments.Fix-finder metadata
04-missing-xml-docs30/30(actionability:10, safety:10, scope:10)