jwildfire.org

The official JWildfire forum
It is currently Sat Feb 16, 2019 10:13 am

All times are UTC+01:00




Post new topic  Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Sun Dec 16, 2018 6:54 am 
Offline
User avatar

Joined: Wed Feb 12, 2014 4:50 pm
Posts: 98

I am working on a script and have found that the best gradient option for it is as follows:

Create new gradient
Random_Symmetry_Generator = Strong hue
Random points 50
Fade colors - box checked
Uniform widths - box checked

Is there a way to code this in a script? Thanks so much for any help given!

Missy


Top
   
PostPosted: Sun Dec 16, 2018 9:49 pm 
Offline
Site Admin
User avatar

Joined: Wed May 15, 2013 10:28 pm
Posts: 1350
Everything can be scripted ;-)

This example creates a new gradient with your desired settings and applies it to the current layer:
Code:
import org.jwildfire.create.tina.script.ScriptRunnerEnvironment;
import org.jwildfire.create.tina.randomgradient.StrongHueRandomGradientGenerator;
import org.jwildfire.create.tina.palette.RGBPalette;

public void run(ScriptRunnerEnvironment pEnv) throws Exception {
  boolean fadeColors = true;
  int randomPoints = 50;  
  boolean uniformWidth = true;
  StrongHueRandomGradientGenerator gradientGen = new StrongHueRandomGradientGenerator();
  RGBPalette newGradient = gradientGen.generatePalette(randomPoints, fadeColors, uniformWidth); 
  if(pEnv.getCurrLayer()!=null) {
    pEnv.getCurrLayer().setPalette(newGradient);
    pEnv.refreshUI();
  }
}
Cheers!


Top
   
PostPosted: Mon Dec 17, 2018 7:16 pm 
Offline
User avatar

Joined: Wed Feb 12, 2014 4:50 pm
Posts: 98
Thank you Andreas. Much appreciated!


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 3 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Limited
Theme Created by HOLLYSMOKE
Theme updated to phpBB 3.1.6 by KamijouTouma
Theme Version is 3.1.6-ss2