PS_SETCOLOR(3)

πŸ’– PS_setcolor β€” setting the vibe (aka the current color) πŸ’–

okay bestie, so this one is from the pslib library functions manual (the Library Functions Manual girlies, you know the ones), and it's literally just "how do I make things a color" and honestly? iconic. no cap.


✨ SYNOPSIS ✨

#include <pslib.h>

void PS_setcolor(PSDoc *psdoc, const char *type, const char *colorspace,
float c1, float c2, float c3, float c4)

πŸŽ€ DESCRIPTION πŸŽ€

so this sets the color for drawing, filling, or both. that's the whole job. main character energy, honestly.

the colorspace should be one of 'gray', 'spot', 'rgb,, 'cmyk', or 'pattern'. (yes the quote situation on 'rgb, is giving exactly what it's giving in the original, don't come for me πŸ’…)

depending on which colorspace you picked, either only the first parameter, the first two, the first three, or all the remaining ones get used. so like β€” don't just throw random numbers in there and hope, okay?

  • if colorspace is 'pattern' then c1 must contain the pattern id, as returned by PS_begin_pattern(3) πŸ¦‹
  • if colorspace is 'spot' then c1 must contain the spot color id, as returned by PS_makespotcolor(3), and c2 must contain the tint value for the color 🌸

and the type parameter can be 'fillstroke', 'fill', or 'stroke'.


πŸ’€ BUGS πŸ’€

not me having to tell you this but the second parameter is currently not in any case evaluated. like. at all. zero. the color is always set for filling and drawing, just as if 'both' were passed. so whatever you put in type, bestie, the library is gonna ignore it and do its own thing πŸ™ˆ

so if you want to set the color in order to define a spot color from it, you will have to pass 'both' or 'fill', because PS_makespotcolor(3) utilizes the current fill color. periodt. don't skip this one, it will absolutely get you.


πŸ‘‘ SEE ALSO πŸ‘‘


🫢 AUTHOR 🫢

this manual page was written by Uwe Steinmann <uwe@steinmann.cx>. thank you for your service king πŸ™


and that's the whole page bestie!! this absolute gem lives in the Library Functions Manual as PS_SETCOLOR(3) β€” go forth and color things, you got this πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from