Documentation Center

  • Trial Software
  • Product Updates

LightColor

Color of light

Value Summary

InheritedColor

Description

LightColor sets the color of user-defined light sources such as plot::AmbientLight, plot::DistantLight etc.

The value of LightColor must be an RGB or RGBa color, i.e., a list of three or four numerical values between 0 and 1. (The fourth value is the opacity entry of an RGBa color. It is accepted but does not have any effect on the light color.)

The RGB library provides many predefined colors such as RGB::Blue etc. See Section  of this document for more information on colors.

LightColor cannot be animated.

Examples

Example 1

We define a white box and illuminate it by a yellow distant light:

b := plot::Box(-1..1, -1..1, -1..1, Color = RGB::White):
light := plot::DistantLight([-1, -2, 3], [0, 0, 0], 
                            Color = RGB::Yellow):
plot(b, light, Axes = None)

We change the color of the light source:

light::LightColor := RGB::Blue:
plot(b, light, Axes = None)

delete b, light:

See Also

MuPAD Functions

Was this topic helpful?