简体   繁体   中英

Illustrator Vector in Pygame/Python

I do not know if this is doable but I am making a program in pygame and wanted to know if I could change the color of a vector file from python/pygame. I have a color wheel and would like to know if the user can use the selected color on an image. Is there another file format that makes this possible? Thanks.

Edit:

I found svgwrite, but how could I change to color of the SVG. Thanks

Probably your best bet is to store the image you want to "tint" as a grayscale bitmap, and then use a line like this to "tint" it in whatever direction you want:

surface.fill(color, special_flags=BLEND_RGB_MULT)

An alternative method would be to use a palette (old-school!) for your image, and have the user pick the palette.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM