Git Product home page Git Product logo

figma-easing-gradients's People

Contributors

alexwidua avatar gsajith avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

gsajith darknoon

figma-easing-gradients's Issues

Support different color models

Right now, interpolation happens (afaik) in sRGB gamma space. Since we're adding gradient stops, we can affect how the colors in the gradient are interpolated.

With a different color space, this would look more natural for example:

Screenshot 2022-06-29 at 11 04 14 AM

See photoshop's documentation

Options that might be interesting:

Decide on number of interpolation steps dynamically

Right now the plugin adds N = 15 steps between each stop, but this could be determined better dynamically

Each segment being a linear interpolation, we could pick

  • dynamically subdivide until the greatest error from the curve is less than some threshold in RGB
  • dynamically subdivide to minimize noticeable changes ie based on the size that the gradient is displayed
  • pick N, but optimize the locations to optimally reduce the error from the true curve (ie more in areas of greater curvature)

Re-apply existing gradient easing

After using it for awhile, I wish I could click "reset" that would bring it back to its original state with just two color stops so that I could adjust the color, and then reapply the easing gradient.
(Via [at]baldur in Figma community, Comment Link)

Simplify color easing model?

Is there a way to do away with adjusting the spline curve manually for most use cases?

Assume two-gradient-stop case for simplicity.

I think there are two rough kinds of gradient:

Exponential Falloff

  • simulates a shadow in a diffuse environment
  • initial slope should be negative
  • final slope should be 0

Screenshot 2022-06-29 at 10 50 59 AM

Easing

  • initial and final slopes should be 0

Screenshot 2022-06-29 at 10 55 12 AM

Comparison to Photoshop model

I think the photoshop model seems slightly more intuitive for the easing case, with

  • a "smoothness" parameter that roughly adjust the interpolation to hit a slope of 0 at each control point
  • midpoint adjusters to adjust how the model biases the interpolation for each interval

Screenshot 2022-06-29 at 10 45 59 AM

Overall, I think that the midpoint adjusters in Ps don't lead to a nice-looking result. But, I like the idea and their function could nicely align to moving both handles in the both-slope-0 case

Screenshot 2022-06-29 at 10 58 09 AM

Editing / resetting workflow can be unintuitive

With my changes, it can be unintuitive where you add a gradient easing and go to change the transform on the gradient.

Then you reset the easing and the transform also resets.

Possible ways to fix?

  • do a similarity comparison with the other gradients on the layer to copy over the other settings (can be tricky if they changed one of the colors)
  • add a copy of the gradient in the fills, hiding the original instead of replacing. you can reset yourself by just deleting that gradient. if you change the transform on the eased gradient, then that would get copied across if they're still next to eachother in the list

Support gradient strokes better

Little demo with LCH interpolation on a radial gradient. I just used shift-X to swap to a stroke, though that messes up the logic I had around the saved fills a bit. So maybe this use case should be considered.

Screenshot 2022-06-30 at 12 55 27 PM

Screenshot 2022-06-30 at 12 56 03 PM

Screenshot 2022-06-30 at 12 56 33 PM

Easing with multiple stops

Have you considered adding support for multiple stops + respecting the starting positions of the stops? If I have a gradient with multiple color stops, right now the plugin only takes the first and last colors into account, and also places them at 0% and 100%, respectively.

Screen Shot 2021-06-09 at 2 57 35 PM

This results in angular gradients having this harsh transition point at 0%

Screen Shot 2021-06-09 at 2 58 11 PM

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.