Skip to content

Commit

Permalink
fix: ability to overwrite alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
mineejo committed Nov 25, 2023
1 parent 3d043f0 commit ba2a513
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions component_effects/alpha_component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ export function alphaComponent(
): Rgba | Rgb {
components = [...components];

if (alpha && components.length === 3) components.push(percent(percentage));
if (alpha) components[3] = percent(percentage);
else if (components.length === 4) components.pop();

return components;
}

0 comments on commit ba2a513

Please sign in to comment.