From 9d8df00ffb587f1e6062ae471d3da3b1ac61ba9e Mon Sep 17 00:00:00 2001 From: frozolotl <44589151+frozolotl@users.noreply.github.com> Date: Wed, 28 Feb 2024 15:09:13 +0100 Subject: Implement alpha modification methods for colors (#3516) Co-authored-by: Laurenz --- tests/typ/compiler/color.typ | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tests') diff --git a/tests/typ/compiler/color.typ b/tests/typ/compiler/color.typ index f165ac0f..ac83355d 100644 --- a/tests/typ/compiler/color.typ +++ b/tests/typ/compiler/color.typ @@ -83,3 +83,19 @@ #test-repr(luma(20%).lighten(50%), luma(60%)) #test-repr(luma(80%).darken(20%), luma(64%)) #test-repr(luma(80%).negate(space: luma), luma(20%)) + +--- +// Test alpha modification. +// Ref: false +#test-repr(luma(100%, 100%).transparentize(50%), luma(100%, 50%)) +#test-repr(luma(100%, 100%).transparentize(75%), luma(100%, 25%)) +#test-repr(luma(100%, 50%).transparentize(50%), luma(100%, 25%)) +#test-repr(luma(100%, 10%).transparentize(250%), luma(100%, 0%)) +#test-repr(luma(100%, 40%).transparentize(-50%), luma(100%, 70%)) +#test-repr(luma(100%, 0%).transparentize(-100%), luma(100%, 100%)) + +#test-repr(luma(100%, 50%).opacify(50%), luma(100%, 75%)) +#test-repr(luma(100%, 20%).opacify(100%), luma(100%, 100%)) +#test-repr(luma(100%, 100%).opacify(250%), luma(100%, 100%)) +#test-repr(luma(100%, 50%).opacify(-50%), luma(100%, 25%)) +#test-repr(luma(100%, 0%).opacify(0%), luma(100%, 0%)) -- cgit v1.2.3