PS_SHADING(3)

πŸ’– PS_SHADING πŸ’–

okay bestie, listen β€” this is the Library Functions Manual page for PS_shading, and it's genuinely such a slay little function. she makes gradients. she's the reason your PDF has that soft pretty fade instead of a hard ugly edge. icon behaviour, honestly.


✨ NAME ✨

PS_shading β€” Create shading

like... she creates a shading. that's the whole job. and she eats every time πŸ’…


🌸 SYNOPSIS 🌸

#include <pslib.h>

int PS_shading(PSDoc *psdoc, const char *shtype, float x0, float y0,
float x1, float y1, float c1, float c2, float c3, float c4, const char
*optlist)

yes the parameter list is long, no we are not skipping any of them, every single one is doing her part 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

so this function creates a shading, right? and that shading can then be used by PS_shfill(3) or PS_shading_pattern(3). that's the whole pipeline, that's the vibe.

the type of shading β€” shtype, bestie β€” can be either radial or axial. those are your only two options, no cap.

every shading starts with the current fill color and ends with the given color values passed in the parameters c1 to c4. (peep PS_setcolor(3) if you wanna know what those actually mean, i'm not gatekeeping but also that's a whole other page.)

the coordinates x0, y0, x1, y1 are the start and end point of the shading. start point, end point. that's the direction, that's the trajectory, that's her main character arc.

πŸŽ€ heads up though: if the shading is of type radial, the option list must also contain the parameters r0 and r1 β€” the radius of the start circle and the end circle respectively. not optional. mandatory. she said fill in the blanks or we're not doing this.

and the color of the shading can be in any color space you want β€” except for pattern. that one's off the table. don't even try it. πŸ’€


⭐ RETURN VALUE ⭐

she returns the identifier of the shading, or zero if something went wrong. (zero = the error era, we don't talk about her.)

and the identifier is a positiv number. that's a positive number, spelled the way the original spelled it, and we're keeping it exactly like that because facts stay facts even when the vibes are immaculate. πŸ’œ


🌈 SEE ALSO 🌈

the girlies that pick up what she puts down. the whole friend group fr fr.


πŸ‘‘ AUTHOR πŸ‘‘

this manual page was written by Uwe Steinmann uwe@steinmann.cx. absolute legend, wrote the docs, respect on the name. 🫑


and that's the page!! sourced straight from the Library Functions Manual β€” this is PS_SHADING(3), section 3, and no date on the tin so i'm not making one up. go make something pretty, bestie, the gradients are waiting βœ¨πŸŽ€πŸ’–

πŸ“¦ where this page comes from