Skip to content

Document culture-invariant color strings from CommunityToolkit.Maui PR #2874 - #678

Draft
Brandon Minnick (TheCodeTraveler) wants to merge 5 commits into
MicrosoftDocs:mainfrom
TheCodeTraveler:docs/pr-2874
Draft

Brandon Minnick (TheCodeTraveler) wants to merge 5 commits into
MicrosoftDocs:mainfrom
TheCodeTraveler:docs/pr-2874

Conversation

@TheCodeTraveler

Copy link
Copy Markdown
Contributor

This PR coincides with the work done in CommunityToolkit.Maui PR CommunityToolkit/Maui#2874.

CommunityToolkit/Maui#2874 (fixes CommunityToolkit/Maui#2873) makes color strings culture-invariant when no culture is passed. This PR documents it:

  • Color conversion extensions: a new Culture section covering no culture or null, InvariantCulture, and other cultures. Examples show the exact output of each case, plus a breaking-change note versus v17.0.0.
  • The five color-string converters (RGBA, CMYK, CMYKA, HSL, HSLA): the Culture sections now say that bindings use ConverterCulture, else CurrentUICulture. They show how to get the documented format with ConverterCulture=InvariantCulture, and carry the same behavior-change note.
  • Fixes on the touched pages:
    • The real namespace in every snippet: CommunityToolkit.Maui.Core.Extensions.
    • The hue of Colors.Red is 360.
    • A wrong HSLA example is corrected.
    • The converter list calls ColorToRgbaStringConverter two-way.

This stays a draft until the CommunityToolkit.Maui release that ships #2874 is published.

🤖 Generated with Claude Code

…874)

ToRgbaString, ToCmykString, ToCmykaString, ToHslString and ToHslaString now
return the documented format when no culture or null is passed, and for
InvariantCulture. The five color-string converters keep the binding
behavior (ConverterCulture, else CurrentUICulture).

Add the behavior-change note versus v17.0.0 to the extensions page and the
culture section of each converter page. Fix the HSLA example, the Colors.Red
hue (360), the RGBA format name and the extension usings in the touched
sections.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The note said bindings are unchanged, but an invariant binding culture now
writes 100% instead of 100 % on the CMYK, CMYKA, HSL and HSLA pages. Also
fix a dangling modifier and name the color in two examples.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The behavior-change note omitted that InvariantCulture now returns 100% instead of 100 %, and its CurrentCulture advice failed for an invariant current culture.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The page mixed CommunityToolkit.Maui.Core.Extensions with CommunityToolkit.Maui.Extensions.Core, which does not exist.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It derives from BaseConverter and converts RGBA strings back to colors.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@learn-build-service-prod

Copy link
Copy Markdown
Contributor

PoliCheck Scan Report

The following report lists PoliCheck issues in PR files. Before you merge the PR, you must fix all severity-1 and severity-2 issues. The AI Review Details column lists suggestions for either removing or replacing the terms. If you find a false positive result, mention it in a PR comment and include this text: #policheck-false-positive. This feedback helps reduce false positives in future scans.

✅ No issues found

More information about PoliCheck

Information: PoliCheck | Severity Guidance | Term
For any questions: Try searching the learn.microsoft.com contributor guides or post your question in the Learn support channel.

@learn-build-service-prod

Copy link
Copy Markdown
Contributor

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Color conversion not behaving as expected

1 participant