|
SOLUTIONS
|
BUILT-IN MATHEMATICA SYMBOL
VertexColors
VertexColors
is an option for graphics primitives which specifies the colors to assign to vertices.
DetailsDetails
- VertexColors can be used with Polygon, Line, Tube, Point, and GraphicsComplex.
- VertexColors->{col1, col2, ...} specifies that color
should be assigned to vertex i. - The interior of the polygon is colored by interpolating between the colors specified by VertexColors.
- In 3D, settings for VertexColors can include any surface or material property, to be used with simulated lighting.
- The colors
for each vertex can be an explicit color directive such as GrayLevel[g] or RGBColor[r, g, b], or can have the following forms: -
g GrayLevel[g] {g,a} GrayLevel[g, a] {r,g,b} RGBColor[r, g, b] {r,g,b,a} RGBColor[r, g, b, a]
ExamplesExamplesopen allclose all
Basic Examples (9)Basic Examples (9)
Specify vertex colors for 2D polygons:
| In[1]:= |
| Out[1]= | ![]() |
Specify vertex colors for 3D polygons:
| In[1]:= |
| Out[1]= | ![]() |
Specify vertex colors for 2D lines:
| In[1]:= |
| Out[1]= | ![]() |
Specify vertex colors for 3D lines:
| In[1]:= |
| Out[1]= | ![]() |
Specify vertex colors for tubes:
| In[1]:= |
| Out[1]= | ![]() |
Specify vertex colors for 2D points:
| In[1]:= |
| Out[1]= | ![]() |
Specify vertex colors for 3D points:
| In[1]:= |
| Out[1]= | ![]() |
Opacity can be specified for each vertex as well:
| In[1]:= |
| Out[1]= | ![]() |
Assign colors for shared vertices:
| In[1]:= |
| In[2]:= |
| In[3]:= |
| Out[3]= | ![]() |
New in 6
Mathematica 9 is now available!
New to Mathematica?
Find your learning path »
Have a question?
Ask support »










