| Tip: This example assumes that you are familiar with Ultra Fractal basics as explained in the tutorials. |
In the previous example, we saw how a class can implement the behavior of an entire fractal formula. However, it's also possible to use classes in a more fine-grained way, exposing all aspects of a formula for maximum flexibility.
The Orbit Traps coloring class is an example of this. The old Orbit Traps coloring algorithm (still available in Standard.ucl) contained parameters such as trap shape, trap mode and trap coloring, each with a number of options. In the new version, implemented as a coloring class in Standard.ulb, these are now class parameters. Every option is now a separate class. Let's have a look:
| First, use the browser to open the Default parameter set in Examples.upr. | ||
Click the Browse button in the Outside tab of the Layer Properties tool window to select Generic Coloring (Gradient) in Standard.ucl. |
Like Generic Formula, Generic Coloring (Gradient) is a skeleton coloring algorithm that lets a coloring class do the work. By default, it loads with the Smooth algorithm.
Click the Browse button for the Coloring Algorithm parameter to select the Orbit Traps class in Standard.ulb. |
As you can see, the Orbit Traps class uses class parameters for all major parameters. All trap shapes, for example, are now implemented as separate classes. Let's select a different trap shape.
Click the Browse button for the Trap Shape parameter to select the Gaussian Integer class. |

The old Gaussian Integer coloring algorithm in Standard.ucl actually is a variation on an orbit trap, just with a different trap shape. It had limited options to color the trap shape, but now that it is available as a general trap shape class, we can combine it with any trap mode or trap coloring.
For example, you can select Angle to Origin 2 as the trap coloring to get an effect that you couldn't create with the original Gaussian Integer coloring algorithm.
When formula authors write new trap shapes, trap modes or trap colorings and make them available in class library files via the public formula library, you can just drop them into this standard Orbit Traps class to use them.
Next: Working with classes