DW-35: Align Color FromName with System.Drawing#141
Merged
mee-ironsoftware merged 2 commits intodevelopfrom Aug 18, 2025
Merged
DW-35: Align Color FromName with System.Drawing#141mee-ironsoftware merged 2 commits intodevelopfrom
mee-ironsoftware merged 2 commits intodevelopfrom
Conversation
mee-ironsoftware
requested changes
Aug 11, 2025
Member
mee-ironsoftware
left a comment
There was a problem hiding this comment.
Please check my feedback.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Title
Align
Color.FromNamebehavior withSystem.Drawingand add support forRebeccaPurple.Description
This PR updates the
Colorclass inIronSoftware.Drawingto align itsFromNamebehavior with the standardSystem.Drawing.Colorimplementation.Key changes:
Updated
Color.FromName(string name)to return a fully transparent black color (ARGB = 0) instead of throwing an exception for unknown color names.Introduced a new property
IsKnownColorto indicate whether a color is from the predefined list.Added support for the
RebeccaPurplecolor:Added to
KnownColorenum.Added to
ArgbValuesand Names arrays inKnownColors.cs.Updated
FromKnownColor()method to properly setIsKnownColor.These changes improve compatibility with the
System.Drawingnamespace, prevent unnecessary exceptions, and support extended color definitions (e.g., "Light1", "Accent1").Fixes DW-35
Type of change
Please select the relevant option by placing an 'x' inside the brackets, like this: [x].
How Has This Been Tested?
Unit tests were added and updated in
Should_Create_FromName()to verify:RebeccaPurplereturns ARGB (255, 102, 51, 153) and setsIsKnownColor = true.Unknown color name like
NotAColorreturns a color with ARGB = (0, 0, 0, 0) andIsKnownColor = false.Checklist:
Please run through the checklist as much as possible and mark the items completed by placing an 'x' inside the brackets, like this: [x].
Additional Context
N/A