Creates a color behavior that represents a color given by hue, saturation, and lightness values. The behavior's value at any given time depends on the values of h, s, and l. The following example creates a color whose hue varies with time, but whose saturation and lightness values are constant:
//vary the hue over time ColorBvr animCol = colorHsl(localTime, toBvr(0.5), toBvr(0.5));
public static ColorBvr colorHsl(
NumberBvr h,
NumberBvr s,
NumberBvr l
);
Returns the ColorBvr object.
Hue, saturation, and lightness values can range from 0.0 to 1.0. If the corresponding number behavior has a value outside this range, then the number is considered modulo 1.
Creates a color behavior that represents a color given by red, green, and blue intensity values. The behavior's value at any given time depends on the values of r, g, and b. The following example creates a color behavior whose red component varies from 0 to 1:
//Create a sawtooth wave that goes repetitively from 0 to 1 //Do this by taking the modulus of localTime and 1 NumberBvr sawtooth = mod(localTime, toBvr(1)); //Now create the RGB color, making red = to the value of sawtooth ColorBvr col = colorRgb(sawtooth, toBvr(0), toBvr(0));
public static ColorBvr colorRgb(
NumberBvr r,
NumberBvr g,
NumberBvr b
);
Returns the ColorBvr object.
Intensity values can range from 0.0 to 1.0. If the corresponding number behavior has a value outside this range, the integer part of the value is discarded and only the fractional part is used.
Creates a color behavior that represents a color given by red, green, and blue intensity values. The behavior's value at any given time depends on the values of r, g, and b. These values can be in the range [0, 255].
public static ColorBvr colorRgb255(
short r,
short g,
short b
);
Returns the ColorBvr object.
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.