Skip to content

Support gradient midpoint interpolation #278

@kyamagu

Description

@kyamagu

Summary

Photoshop gradients support midpoint values between color stops that control the interpolation between colors. Currently, psd2svg uses simple linear interpolation and ignores midpoint values.

Current Behavior

  • Gradients with non-default midpoints (not 50%) trigger a debug warning but are rendered with linear interpolation
  • Related code locations:

Expected Behavior

Gradients should honor midpoint values to match Photoshop's rendering more accurately.

Implementation Notes

Midpoint in Photoshop affects the interpolation curve between two gradient stops. A midpoint of 50% results in linear interpolation, while values below 50% shift the transition toward the first color, and values above 50% shift it toward the second color.

Related Files

  • src/psd2svg/core/gradient.py
  • src/psd2svg/core/paint.py

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions