Skip to content

Tiny typo in libMix formula results in broken mix results #559

@Uriziel01

Description

@Uriziel01

Method function libMix($args) returns wrong results for colors with alpha channels (negative alpha channel results and so on) because it has a typo in line

$new[] = $firstAlpha * $weight + $secondAlpha * ($weight - 1);

where in the original Ruby implementation it was https://github.com/sass/sass/blob/6bfe2eaa912501a8d349f437b8b5b8cd140b3267/lib/sass/script/functions.rb#L1426

(Note the ($weight - 1); and (1 - p) swapped order)

After just replacing it for (1 - $weight); it works as intended 😄

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions