Search in sources :

Example 1 with AllRandomGradientGenerator

use of org.jwildfire.create.tina.randomgradient.AllRandomGradientGenerator in project JWildfire by thargor6.

the class FlameControlsDelegate method randomizeLightColor.

public void randomizeLightColor() {
    DistantLight light = getSolidRenderingSelectedLight();
    if (light != null) {
        owner.undoManager.saveUndoPoint(getCurrFlame());
        List<RGBColor> rndColors = new AllRandomGradientGenerator().generateKeyFrames(7);
        RGBColor rndColor = rndColors.get((int) (Math.random() * rndColors.size()));
        Color selectedColor = new Color(rndColor.getRed(), rndColor.getGreen(), rndColor.getBlue());
        setLightColor(light, selectedColor);
    }
}
Also used : AllRandomGradientGenerator(org.jwildfire.create.tina.randomgradient.AllRandomGradientGenerator) Color(java.awt.Color) RGBColor(org.jwildfire.create.tina.palette.RGBColor) Stereo3dColor(org.jwildfire.create.tina.base.Stereo3dColor) RGBColor(org.jwildfire.create.tina.palette.RGBColor) DistantLight(org.jwildfire.create.tina.base.solidrender.DistantLight)

Example 2 with AllRandomGradientGenerator

use of org.jwildfire.create.tina.randomgradient.AllRandomGradientGenerator in project JWildfire by thargor6.

the class RandomGradientMutation method execute.

@Override
public void execute(Layer pLayer) {
    int keyFrames = 3 + Tools.randomInt(56);
    boolean fadePaletteColors = Math.random() > 0.33;
    boolean uniformWidth = Math.random() > 0.75;
    RGBPalette palette = new AllRandomGradientGenerator().generatePalette(keyFrames, fadePaletteColors, uniformWidth);
    pLayer.setPalette(palette);
}
Also used : RGBPalette(org.jwildfire.create.tina.palette.RGBPalette) AllRandomGradientGenerator(org.jwildfire.create.tina.randomgradient.AllRandomGradientGenerator)

Aggregations

AllRandomGradientGenerator (org.jwildfire.create.tina.randomgradient.AllRandomGradientGenerator)2 Color (java.awt.Color)1 Stereo3dColor (org.jwildfire.create.tina.base.Stereo3dColor)1 DistantLight (org.jwildfire.create.tina.base.solidrender.DistantLight)1 RGBColor (org.jwildfire.create.tina.palette.RGBColor)1 RGBPalette (org.jwildfire.create.tina.palette.RGBPalette)1