Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More consistent legacy color conversion #37

Merged
merged 1 commit into from
Feb 11, 2024

Conversation

tecosaur
Copy link
Collaborator

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
Collaborator 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
6 checks passed
@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