Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Merged
dantleech merged 13 commits into
php-tui:mainfrom
KennedyTedesco:style
Nov 17, 2023
Merged

Add a fluent api to work with fg/bg colors and modifiers#136
dantleech merged 13 commits into
php-tui:mainfrom
KennedyTedesco:style

Conversation

@KennedyTedesco

@KennedyTedesco KennedyTedesco commented Nov 17, 2023

Copy link
Copy Markdown
Contributor

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')

Comment thread src/Model/Style/InteractsWithBgColor.php Outdated
@dantleech
dantleech merged commit 908ba2e into php-tui:main Nov 17, 2023
@dantleech

Copy link
Copy Markdown
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