VertexColors
✖
VertexColors
is an option for graphics primitives which specifies the colors to assign to vertices.
Details

- VertexColors can be used with Polygon, Line, Tube, Point, and GraphicsComplex.
- VertexColors->{col1,col2,…} specifies that color coli 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 coli 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]
Examples
open allclose allBasic Examples (9)Summary of the most common use cases
Specify vertex colors for 2D polygons:

https://wolfram.com/xid/0rtdmwyj6-by2qz9

Specify vertex colors for 3D polygons:

https://wolfram.com/xid/0rtdmwyj6-l58qcl

Specify vertex colors for 2D lines:

https://wolfram.com/xid/0rtdmwyj6-cn0av

Specify vertex colors for 3D lines:

https://wolfram.com/xid/0rtdmwyj6-gff7zx

Specify vertex colors for tubes:

https://wolfram.com/xid/0rtdmwyj6-gdsgth

Specify vertex colors for 2D points:

https://wolfram.com/xid/0rtdmwyj6-g3z8y

Specify vertex colors for 3D points:

https://wolfram.com/xid/0rtdmwyj6-fkwrh4

Opacity can be specified for each vertex as well:

https://wolfram.com/xid/0rtdmwyj6-lgy12

Assign colors for shared vertices:

https://wolfram.com/xid/0rtdmwyj6-oj5cw

https://wolfram.com/xid/0rtdmwyj6-hebi7

https://wolfram.com/xid/0rtdmwyj6-eibhbd

Scope (1)Survey of the scope of standard use cases
Some plot functions, such as ListPlot3D, support VertexColors:

https://wolfram.com/xid/0rtdmwyj6-gbb7dj

https://wolfram.com/xid/0rtdmwyj6-dh1jju

https://wolfram.com/xid/0rtdmwyj6-kv3oge

Neat Examples (2)Surprising or curious use cases
Create opacity gradients on 3D polygons:

https://wolfram.com/xid/0rtdmwyj6-b9q7z3

Use an image from ExampleData:

https://wolfram.com/xid/0rtdmwyj6-gv7e2q
Plot the dataset with vertex colors, simulating the texture:

https://wolfram.com/xid/0rtdmwyj6-nz9bo8

Wolfram Research (2007), VertexColors, Wolfram Language function, https://reference.wolfram.com/language/ref/VertexColors.html (updated 2008).
Text
Wolfram Research (2007), VertexColors, Wolfram Language function, https://reference.wolfram.com/language/ref/VertexColors.html (updated 2008).
Wolfram Research (2007), VertexColors, Wolfram Language function, https://reference.wolfram.com/language/ref/VertexColors.html (updated 2008).
CMS
Wolfram Language. 2007. "VertexColors." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2008. https://reference.wolfram.com/language/ref/VertexColors.html.
Wolfram Language. 2007. "VertexColors." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2008. https://reference.wolfram.com/language/ref/VertexColors.html.
APA
Wolfram Language. (2007). VertexColors. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/VertexColors.html
Wolfram Language. (2007). VertexColors. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/VertexColors.html
BibTeX
@misc{reference.wolfram_2025_vertexcolors, author="Wolfram Research", title="{VertexColors}", year="2008", howpublished="\url{https://reference.wolfram.com/language/ref/VertexColors.html}", note=[Accessed: 21-May-2025
]}
BibLaTeX
@online{reference.wolfram_2025_vertexcolors, organization={Wolfram Research}, title={VertexColors}, year={2008}, url={https://reference.wolfram.com/language/ref/VertexColors.html}, note=[Accessed: 21-May-2025
]}