##### Ninja Library - Light Function

# njSetLightColor

Sets the color for light that was set by the njCreateLight() function

### FORMAT

`

  void njSetLightColor( *ptr , red , green , blue )
  NJS_LIGHT *ptr
  Float red
  Float green
  Float blue

`

### PARAMETER

  `*ptr` | Pointer to light source
  `red` | Red light source
  `green` | Green light source
  `blue` | Blue light source

### RETURN

  None

### DESCRIPTION

  Sets the light source color using the three primary colors. 1.f stands for 100%. By default, all components are 100% (white).

### EXAMPLE

      #include <Shinobi.h>
      	:
      NJS_LIGHT light;
      sbInitSystem( NJD_RESOLUTION_VGA, NJD_FRAMEBUFFER_MODE_RGB565, 1);
      njCreateLight(&light, NJD_DIR_LIGHT);
      	:
      /* Parallel light source set using RGB value 1,0,0 (red) */
      njSetLightColor(&light, 1.f, 0.f, 0.f);

### NOTE

  The NJD_USER_LIGHT light source is set in `njCreateLight()` function. When `njFastDrawModel(),` `njFastDrawObject(),` `njFastDrawMotion(),` and `njFastAction()` are specified (when using illumination), this function is changed as shown below. To calculate the callback function component of the first parameter (NJS_ARGB *), refrain from referring to any components except a (alpha) and r (red). These are understood as diffuse (alpha) and specula (red) lighting. The light source functions created by the user, and the macros used in them, are as shown below.

### REFERENCE

  `njCreateLight()
  `

njSetLightColor

COPYRIGHT © SEGA ENTERPRISES, LTD., 1998,1999