Extends all Color objects to support hue/saturation/value properties.
Category
Latest Behaviors
Author
Gavin Kistner
Difficulty
(Reference)
Time to Complete
5 Minutes
Downloads
Click Here
to download the associated files.
(This document covers version 1.0 of the 'HSV Colors' behavior, current as of 2005-Feb-11)
Description
This utility library extends Color objects to support
.h
,
.s
, and
.v
properties for
HSV
(Hue, Saturation, Value) manipulations.
Hue values are specified and returned as numbers in the range 0..360, with pure red being 0, pure green 120, and pure blue 240.
Saturation and Value values are specified and returned as numbers in the range 0..100.
To use, simply attach this behavior anywhere in the scene. (You have to actually attach it to add the functionality; loading it into the library for the project is not enough.)
Example code:
//Set the material to a dark red color
myMaterial.diffuse = new Color( 150, 0, 0 );
Note that changes to the hue or saturation do not take effect when the value is exactly 0, and changes to the hue will not take effect when the saturation is 0.