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

Add a fluent api to work with fg/bg colors and modifiers #136

Merged
merged 13 commits into from
Nov 17, 2023
Merged

Add a fluent api to work with fg/bg colors and modifiers #136

merged 13 commits into from
Nov 17, 2023

Conversation

KennedyTedesco
Copy link
Contributor

@KennedyTedesco KennedyTedesco commented Nov 17, 2023

Partially closes: #109

With this feature, instead of:

Span::styled('[q]', Style::default()->fg(AnsiColor::Red))

We just:

Span::fromString('[q]')->red()

Next step (a new PR): I'll implement a parser, something like:

Line::parse('<fg=green options=bold,italic>Hello</> World')

@dantleech dantleech merged commit 908ba2e into php-tui:main Nov 17, 2023
5 checks passed
@dantleech
Copy link
Collaborator

🎉 nice!

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.

Encapsulate the modifier from the user in Style
2 participants