Documentation Center

  • Trial Software
  • Product Updates

FillColor, FillColor2

Color of areas and surfaces

Value Summary

FillColor, FillColor2InheritedColor

Graphics Primitives

ObjectsDefault Values
plot::Histogram2d

FillColor: RGB::GeraniumLake

plot::Cylindrical, plot::Density, plot::Dodecahedron, plot::Function3d, plot::Hexahedron, plot::Icosahedron, plot::Implicit3d, plot::Matrixplot, plot::Octahedron, plot::Prism, plot::Pyramid, plot::Spherical, plot::Surface, plot::SurfaceSet, plot::SurfaceSTL, plot::Sweep, plot::Tetrahedron, plot::Tube, plot::XRotate, plot::ZRotate

FillColor: RGB::Red

FillColor2: RGB::CornflowerBlue

plot::Box, plot::Circle3d, plot::Cone, plot::Cylinder, plot::Ellipsoid, plot::Plane, plot::Polygon3d, plot::Sphere

FillColor: RGB::LightBlue

plot::Arc2d, plot::Circle2d, plot::Ellipse2d, plot::Hatch, plot::Parallelogram2d, plot::Polygon2d, plot::Rectangle, plot::Sum

FillColor: RGB::Red

plot::Arc3d, plot::Ellipse3d, plot::Parallelogram3d

FillColor: RGB::LightBlue

FillColor2: RGB::CornflowerBlue

plot::Waterman

FillColor: RGB::SafetyOrange

FillColor2: RGB::CornflowerBlue

plot::Integral

FillColor: RGB::PaleBlue

Description

FillColor determines the color used to fill all types of areas and surfaces. FillColor2 is used for color blends. FillColors is used for objects that need more than one color.

2D objects that have a notion of "area" and 3D objects that have a surface support FillColor to determine the primary color to show objects in. If FillColorType is set to Dichromatic, FillColor2 sets the second color to blend to.

Functions and primitives displaying more than one object, such as plot::Bars2d, use FillColors for a list of colors used cyclically.

Examples

Example 1

By default, plot::Hatch objects are hatched in RGB ::Red, the same color used by default for plot::Function2d:

f := plot::Function2d(cos(2*x)+cos(x), x=-PI..PI):
h := plot::Hatch(f):
plot(h, f)

To change the color of the hatch, simply set the "FillColor"-slot to some other value:

h::FillColor := RGB::Grey:
plot(h, f)

Example 2

The default setting for a surface is to have a height-dependent coloring with a linear blend from FillColor to FillColor2:

s := plot::Surface([cos(2*u+v), sin(u+2*v), sin(u+v)],
                   u = 0..2*PI, v = 0..2*PI,
                   ULinesVisible = FALSE, 
                   VLinesVisible = FALSE):
plot(s)

These colors can be manipulated in the usual way. As an example, we set the transition to a monochrome transition from opaque to transparent:

s::FillColor  := RGB::Green:
s::FillColor2 := s::FillColor . [0.0]:
plot(s)

Example 3

Using a utility function randrange that returns random ranges in [0, 1], we can plot random rectangles with random colors:

randrange := () -> _range(op(sort([frandom(), frandom()]))):
plot(plot::Rectangle(randrange(), randrange(),
                     LinesVisible = FALSE,
                     Filled = TRUE, FillPattern = Solid,
                     FillColor = [frandom(), frandom(), frandom()])
     $k=1..20,
     AxesVisible = FALSE)

See Also

MuPAD Functions

Was this topic helpful?