Skip to content

Conversation

@tecosaur
Copy link
Member

When a given "legacy color" argument is not in fact a recognised color
name, legacy_color should return nil, and indeed it does when the
argument is a string.

However, the color symbol method will just return the symbol argument if
it is not recognised, creating an inconsistency in the behaviour.
Instead, it should return nothing, as the string case does.

This change is made, and a little of the surrounding code rearranged for
clarity.

When a given "legacy color" argument is not in fact a recognised color
name, `legacy_color` should return nil, and indeed it does when the
argument is a string.

However, the color symbol method will just return the symbol argument if
it is not recognised, creating an inconsistency in the behaviour.
Instead, it should return nothing, as the string case does.

This change is made, and a little of the surrounding code rearranged for
clarity.
@tecosaur tecosaur force-pushed the more-consistent-legacy-color-conversion branch from eb4f1ed to 7ce4e69 Compare February 11, 2024 10:06
@tecosaur
Copy link
Member Author

This is a minor change, with pretty straightforward justification/details, so I'm inclined to just go ahead and merge it.

@tecosaur tecosaur merged commit 7ce4e69 into main Feb 11, 2024
@tecosaur tecosaur deleted the more-consistent-legacy-color-conversion branch February 11, 2024 11:10
KristofferC pushed a commit to JuliaLang/julia that referenced this pull request Feb 15, 2024
Can be seen as a follow-on from #51829, also wants
JuliaLang/StyledStrings.jl#37
 to behave as expected.
tecosaur added a commit to tecosaur/julia that referenced this pull request Mar 4, 2024
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.

1 participant