Skip to content

Implement FromStr and Display for Color#2937

Merged
hecrj merged 4 commits intoiced-rs:masterfrom
misaka10987:master
Nov 25, 2025
Merged

Implement FromStr and Display for Color#2937
hecrj merged 4 commits intoiced-rs:masterfrom
misaka10987:master

Conversation

@misaka10987
Copy link
Contributor

Currently the Color type has only a non-standard parse method to parse from its string representation, and method to display the color in its string representation is missing.
This PR implements FromStr and Display traits from the standard library using the original implementation of the parse method. This allows users to parse and display colors in an easier way, and makes it possible for stuff like #[serde_as(as = "DisplayFromStr")].

@hecrj hecrj added this to the 0.14 milestone Nov 25, 2025
@hecrj hecrj added improvement An internal improvement feature New feature or request styling change addition labels Nov 25, 2025
Copy link
Member

@hecrj hecrj left a comment

Choose a reason for hiding this comment

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

Thanks!

@hecrj hecrj enabled auto-merge November 25, 2025 22:39
@hecrj hecrj changed the title implement FromStr and Display for Color Implement FromStr and Display for Color Nov 25, 2025
@hecrj hecrj merged commit 6f0b408 into iced-rs:master Nov 25, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

addition change feature New feature or request improvement An internal improvement styling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments