greenhouse
a creative coding toolkit for spatial interfaces

Color methods for Node objects

Controlling the color of a Greenhouse object. Color in Greenhouse can be animated. See here for information on the Color Data Type.

  • AdjColor ()
  • SetAdjColor ()
  • Alpha ()
  • SetAlpha ()
  • Brightness ()
  • ColorAnimateLinear ()
  • ColorAnimateQuadratic ()
  • ColorAnimateAsymp ()
  • ColorAnimateSine ()
  • AdjColorIsStatic ()

Example

#include "Greenhouse.h"

class ColorText  :  public Text
{ public:
  ColorText ()  :  Text ("Color") {}

  void PointingSoften (PointingEvent *e)
    { SetAdjColor (Color (Random(1), Random(1), Random(1))); }

  void Travail ()
    { if (! AdjColorIsStatic())
        SetString (ToStr (AdjColor ()) + ", Brightness: " + ToStr(Brightness()));
    }
};

void Setup ()
{ ColorText *ct = new ColorText ();
  ct -> SlapOnFeld ();
  ct -> SetFontSize (Feld () -> Height () / 20.0);
  ct -> SetWidth (150.0);
  ct -> SetAlpha (0.95);

  ct -> ColorAnimateLinear (1.5);
  //ct -> ColorAnimateQuadratic (1.5);
  //ct -> ColorAnimateAsymp (1.5);
  //ct -> ColorAnimateSine (Color (0.5), 1, 0);
}