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

Implement relative and absolute methods for Lighten/Darken, Saturate #217

Merged
merged 1 commit into from Apr 18, 2021

Commits on Apr 18, 2021

  1. Implement relative and absolute methods for Lighten/Darken, Saturate

    Add `lighten_fixed` and `darken_fixed` methods to the Shade trait. The
    `_fixed` functions inherit similar behavior to the old `lighten/darken`.
    The new implementation scales the color toward the maximum or minimum
    value for lightness or saturation. This should be more intuitive to
    adjust as a small factor could have drastically different results based
    on the color space. The same change is made for saturate/desaturate with
    corresponding `_fixed` methods.
    
    Add doc tests showing new behavior of Saturate and Shade
    Differentiate between the absolute and relative lighten/darken/saturate
    by using `amount` to refer to the fixed/absolute functions and `factor`
    when using the relative versions (the new default version is relative).
    
    Account for negative factors in the saturate and shade functions.
    okaneco committed Apr 18, 2021
    Configuration menu
    Copy the full SHA
    0156b10 View commit details
    Browse the repository at this point in the history