VectorVonDoom Posted January 21, 2020 Share Posted January 21, 2020 I needed a quick script to make it easier to create some styles that contained stripes using the fx gradient overlay but it obviously also works with the standard gradient. With just a few stripes and it's easy enough but when you are doing 20 or more with fractional percentages it's too much for my tiny mind to easily keep track of So just enter the odd and even stripe width percentages then where any padding should go and it lists the gradient stops to add. I copied the output to a text file and as I completed steps just deleted them from the list. It saved me a headache. Don't look too hard at the messy code, it was a quickie! Stripes.py Danika, PierreLR, Bibi McMurray and 1 other 2 2 Quote Marc ArtByMarc.me Link to comment Share on other sites More sharing options...
v_kyr Posted January 22, 2020 Share Posted January 22, 2020 Good idea and can be enhanced to show sort of a preview of the expected gradients then too (you can install and use Pillow for Python3 for image handling). Quote python3 -m pip install Pillow Then as an example for how to making a gradient with that then something like this ... ... # A map of rgb points # [distance, (r, g, b)] # distance is percentage from left edge pointmap = [ [0.0, (0, 0, 0)], [0.20, (0, 0, .5)], [0.40, (0, .5, 0)], [0.60, (.5, 0, 0)], [0.80, (.75, .75, 0)], [0.90, (1.0, .75, 0)], [1.00, (1.0, 1.0, 1.0)], ] ... gradient.py And some more sophisticated source about color gradients with python here (colors as points in 3D space, linear gradients etc.). Interesting, though probably might be over the top for just quick how it looks like visualization purposes. Quote ☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan ☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2 Link to comment Share on other sites More sharing options...
VectorVonDoom Posted January 22, 2020 Author Share Posted January 22, 2020 It could be handy so you could fine tune the gradient rather than start entering them and finding they're not quite what you wanted. Anyway it did what I needed it to do but if someone wants to make a fancy pants version then off you go! Now if only you didn't have to type it all in to AD, we had extensions... (and/or better fx's) v_kyr 1 Quote Marc ArtByMarc.me Link to comment Share on other sites More sharing options...
v_kyr Posted January 22, 2020 Share Posted January 22, 2020 4 hours ago, VectorVonDoom said: Now if only you didn't have to type it all in to AD, we had extensions... (and/or better fx's) Maybe that can be addressed in future via app scripting capabilities in some manner. Quote ☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan ☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2 Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.