In addition to defining colors according to any of our color functions, you can also define colors in the 3D Calculator that depend directly on \((x, y, z)\) coordinates. You can use coordinate-based color maps to create expressive 3D graphs, such as heatmaps, and to explore relationships between different color models.
Get started with our Custom Colors article, and then dive deeper with the examples and concepts on this page.
Defining a Color Map
Start by defining a custom color using one of the supported color functions. Then, include a reference to \(x\), \(y\), or \(z\) in at least one of the parameter inputs.
When you assign coordinate-based colors to a 3D graph object, the object will display a color gradient that depends on the coordinates of each point on the surface.
For example, if you define a color using the function
Color maps can help you visualize different color models. For example, you could explore the cylindrical relationship of the hsv color model. Hue is defined by the angle around the cylinder, saturation is defined by the radius, and value is defined by the height.
As another example, explore the RGB color space here.
Selecting a Color Map
When you define a color map, a dynamic 3D sphere will replace the typical square color swatch. The sphere shows how the color will appear in the 3D space.
This spherical color swatch will also appear when you open an object’s Options menu to select a custom color.
You can apply color maps to 3D surfaces, including those you build implicitly, parametrically, or with functions like triangle and sphere. However, color maps don’t yet work for points or curves, such as slices of surfaces or one-variable parametric curves. For these objects, you will not see the color map swatch in the Options menu.
Learn More
Please write in with any questions or feedback to support@desmos.com.