Skip to content

[fix-finder] Add XML documentation to Android.Graphics.Color static component-accessor methods #11648

@github-actions

Description

@github-actions

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 0255 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

  • Each of the four methods (GetAlphaComponent, GetBlueComponent, GetGreenComponent, GetRedComponent) has <summary>, <param>, and <returns> XML doc comments.
  • No code changes — only XML comment additions.
  • All tests pass.
  • No new warnings introduced.

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 ·

  • expires on Jun 19, 2026, 8:08 PM UTC

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions