RunningRainbow.java
Usage: Place RunningRainbow.class within your HTML directory.
Java Source: RunningRainbow.java
HTML Source:
<applet code=RunningRainbow.class width=95% height=1>
<param name="delay" value="100">
<param name="shift" value="2">
<param name="direction" value="left">
<param name="method" value="gaussian">
<param name="ss" value="0.3">
<param name="ar" value="0.">
<param name="ag" value="0.33">
<param name="ab" value="0.66">
<param name="ar1" value="1.">
</applet>
The applet currently supports two methods of image generation.
- Trapezoid -- this method generates a standard color wheel -- a line with a hue parameter change from 0 to 255. In other words this is a real rainbow line.
This method has no additional generation parameters.
- Gaussian -- this method generates a gaussian peak for each component based on other parameters supplyed.
This method allows to generate some interesting effects.
The parameters are:
- Mean value of each component . The parameters' names are: 'ar', 'ag', 'ab' for read , green and blue components correspondently.
The obvious meaning of this value is -- it shows where the maximum intensity point is.
This parameter is of 'double' type and may have a value on the range between 0 and 1.
(The whole length of the bar is considered to be 1 i.e. the value of 0.5 means -- in the middle of the bar).
- Dispersion of each component -- it sets the width of gaussian peak or better to say the width, where intensity of the particular component reduces to it's one-half. The parameters' names are: 'sr', 'sg', 'sb'.
There are also animation parameters supported. They are:
- 'delay', (Integer) -- delay of animation in milliseconds. Default value: 100;
- 'shift', (Integer) -- shift between two frames of animation. Default Value: 2;
- 'direction', (String) -- direction of animation. Possible values: ["left" | "right"], Default value: "left";
Author: Oleg V. Baranovsky
|