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

Linear and Radial Gradients on main branch #718

Open
wants to merge 23 commits into
base: main
Choose a base branch
from

Conversation

AshishS-1123
Copy link
Contributor

@AshishS-1123 AshishS-1123 commented Apr 21, 2022

Summary / How this PR fixes the problem?

Following features will be implemented in this PR

  • Create a Pattern Component to represent different types of Fill a canvas item can have (Solid, Linear and Radial)
  • Create widget for choosing between different types of pattern (Widgets.PatternTypeChooser)
  • Create widget for adding, removing and modifying stop colors on patterns.
  • Render the selected Pattern on Canvas.
  • Create Nobs for modifying start and end points of gradients on canvas item.
  • Allow saving patterns to colors container
  • Show the created pattern on the ColorButton in fills panel.

Blending Cairo.Patterns requires a little bit of math (Linear Interpolation. Will probably implement it in another PR

Steps to Test

  • Draw some canvas item (like Rectangle or Ellipse).
  • Click on the ColorButton in the Fills Panel. This should open a popover.
  • At the top of the popover, you should see the PatternTypeChooser. Select whichever mode you want,
  • For linear and radial gradients, you can use the GradientEditor widget below PatternTypeChooser to add stop colors and change their colors.
  • With the Popover open, you can also move the gradient nobs around to change position of the pattern.

After creating a pattern, click on the + button to add this pattern to the Global colors. You can then apply the same pattern to any other canvas item by clicking on it.

Screenshots

gradients

Known Issues / Things To Do

  • Blending Lib.Components.Pattern has not been implemented yet.

This PR fixes/implements the following bugs/features:

@Alecaddd Alecaddd added this to the v0.1.0 milestone Apr 24, 2022
@AshishS-1123 AshishS-1123 marked this pull request as ready for review May 1, 2022 07:52
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