Skip to content

Mention supported hex colors #14494

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

Merged
merged 1 commit into from
Oct 30, 2020
Merged

Conversation

freezy-sk
Copy link
Contributor

Mention supported hex colors for foreground and background
Fixes #13795

@OskarStark
Copy link
Contributor

Thank you for this contribution, just a minor comment from my side.

the nearest named color is used.

Can you explain this a little bit "better" or add an example?

Thanks

@OskarStark OskarStark added this to the 5.2 milestone Oct 28, 2020
@@ -40,13 +40,18 @@ It is possible to define your own styles using the
use Symfony\Component\Console\Formatter\OutputFormatterStyle;

// ...
$outputStyle = new OutputFormatterStyle('red', 'yellow', ['bold', 'blink']);
$outputStyle = new OutputFormatterStyle('#F00', 'yellow', ['bold', 'blink']);
Copy link
Contributor

@noniagriconomie noniagriconomie Oct 28, 2020

Choose a reason for hiding this comment

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

Maybe you should mentioned that this only works for sf5.2+ no?
Maybe keep the previous code and add the new code hex with those explanations?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's why is this pull request made into 5.x branch instead of lower version

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes of course, I meant adding a version added docbloc for this version :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sorry I didn't knew that. I added that versionadded and switched red back to previous and changed yellow to hex code. Or do you prefer duplicating that piece of code with note that since 5.2 it can be defined as hexa?

@freezy-sk
Copy link
Contributor Author

@OskarStark thanks, good point. I also made a test for that hidden feature symfony/symfony#38866

fabpot added a commit to symfony/symfony that referenced this pull request Oct 29, 2020
This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

[Console] Test degraded true colors

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#14494 <!-- required for new features -->

Testing hidden feature of hex colors degraded to ANSI named colors for terminals without true color support.

Commits
-------

a26dc09 [Console] Test degraded true colors
symfony-splitter pushed a commit to symfony/console that referenced this pull request Oct 29, 2020
This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

[Console] Test degraded true colors

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#14494 <!-- required for new features -->

Testing hidden feature of hex colors degraded to ANSI named colors for terminals without true color support.

Commits
-------

a26dc0931b [Console] Test degraded true colors
@OskarStark
Copy link
Contributor

OskarStark commented Oct 30, 2020

Thanks Marek for working on this feature, this is much appreciated and congrats on your first contribution to the Symfony docs 🎉

@OskarStark OskarStark merged commit 7f464ac into symfony:5.x Oct 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Console] Add support for true colors
5 participants