/** * Copy one Gradient into another. * * @param g the Gradient to copy into */ public void copyTo(Gradient g) { g.numKnots = numKnots; g.map = map.clone(); g.xKnots = xKnots.clone(); g.yKnots = yKnots.clone(); g.knotTypes = knotTypes.clone(); }
@Override public Object clone() { Gradient g = (Gradient) super.clone(); g.map = map.clone(); g.xKnots = xKnots.clone(); g.yKnots = yKnots.clone(); g.knotTypes = knotTypes.clone(); return g; }
/** * Build a random gradient. * * @return the new Gradient */ public static Gradient randomGradient() { Gradient g = new Gradient(); g.randomize(); return g; }