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

Gradients - From Terminal Text Effects #3586

Merged
merged 40 commits into from
Jul 9, 2024
Merged

Conversation

tznind
Copy link
Collaborator

@tznind tznind commented Jul 7, 2024

I have started looking at Terminal Text Effects python library and did some experimental porting with some Chat GPT help.

I've switched to our Color scheme and Point but the rest is largely unchanged.

Also found a bug in LineCanvas intersections coordinates being wrong on the data model (not actually affecting rendering but came up as I tested the gradient mapping logic).

I initially started porting everything but it got a bit out of hand. This is just the gradient class ported and a showcase.

image

Fixes

  • Fixes #_____

Proposed Changes/Todos

  • No nested classes
  • Tests
  • xmldoc

Pull Request checklist:

  • I've named my PR in the form of "Fixes #issue. Terse description."
  • My code follows the style guidelines of Terminal.Gui - if you use Visual Studio, hit CTRL-K-D to automatically reformat your files before committing.
  • My code follows the Terminal.Gui library design guidelines
  • I ran dotnet test before commit
  • I have made corresponding changes to the API documentation (using /// style comments)
  • My changes generate no new warnings
  • I have checked my code and corrected any poor grammar or misspellings
  • I conducted basic QA to assure all features are working

@tig
Copy link
Collaborator

tig commented Jul 7, 2024

This could be leveraged for

@tznind tznind marked this pull request as ready for review July 7, 2024 20:20
@tznind tznind requested a review from tig as a code owner July 7, 2024 20:20
@tznind
Copy link
Collaborator Author

tznind commented Jul 7, 2024

This could be leveraged for #2800

Yup we could definetly do some kind of color wheel/rectangle thing

Any idea why CI tests are aborting with?

The active test run was aborted. Reason: Test host process crashed : Unhandled exception. System.ArgumentException: There is at least one object in this array that cannot be serialized (Parameter 'array')

@tig
Copy link
Collaborator

tig commented Jul 7, 2024

FYI - your tests may be failing because of work i'm doing on trying to fix #3052. JFYI

@tig
Copy link
Collaborator

tig commented Jul 7, 2024

The github action is back to just running on Windows, so you can merge with v2_develop and try again. Sorry about all this.

@tznind
Copy link
Collaborator Author

tznind commented Jul 8, 2024

This is good to go to review, I will look into color picker but that can be seperate PR.

@tig
Copy link
Collaborator

tig commented Jul 8, 2024

This is good to go to review, I will look into color picker but that can be seperate PR.

I have an old pr for that already. Happy to have you contribute to it.

Copy link
Collaborator

@tig tig left a comment

Choose a reason for hiding this comment

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

See my comments. This is lovely.

Terminal.Gui/Drawing/Gradient.cs Show resolved Hide resolved
Terminal.Gui/Drawing/Gradient.cs Outdated Show resolved Hide resolved
Terminal.Gui/Drawing/SolidFill.cs Outdated Show resolved Hide resolved
@tig
Copy link
Collaborator

tig commented Jul 9, 2024

It'd be cool if TextFormatter had the equivalent of LineCanvas.FillPair, no?

@tig
Copy link
Collaborator

tig commented Jul 9, 2024

It'd also be killer for ProgressBar to have a gradient style:

image

@tig
Copy link
Collaborator

tig commented Jul 9, 2024

PR incoming that does this:

AQkKguh 1

@tig
Copy link
Collaborator

tig commented Jul 9, 2024

tznind#165

Added Border Settings & BorderSettings.Gradient
Copy link
Collaborator

@tig tig left a comment

Choose a reason for hiding this comment

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

LGTM!

UICatalog/Scenarios/TextEffectsScenario.cs Outdated Show resolved Hide resolved
@tig
Copy link
Collaborator

tig commented Jul 9, 2024

Do you think this is ready to merge @tznind. I do.

@tznind
Copy link
Collaborator Author

tznind commented Jul 9, 2024

Yup good to go!

I looked at TextFormatter but looks non trivial. Can investigate in another pr but I might look to do HSL style true color picker first.

I also want to look at what else text effects has that we could port.

@tig tig merged commit 4d86227 into gui-cs:v2_develop Jul 9, 2024
3 checks passed
@tznind tznind deleted the gradients branch July 10, 2024 03:14
@tig
Copy link
Collaborator

tig commented Jul 10, 2024

@tznind please confirm you received email with reshaper license.

@tznind
Copy link
Collaborator Author

tznind commented Jul 10, 2024 via email

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.

2 participants