# Colour of functions and points on the graph using code in CL

**URL:** <https://cl.desmos.com/t/colour-of-functions-and-points-on-the-graph-using-code-in-cl/634>\
**Category:** Questions\
**Created:** [December 1, 2019, 8:51am UTC](https://cl.desmos.com/t/colour-of-functions-and-points-on-the-graph-using-code-in-cl/634 "2019-12-01T08:51:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![chris.young36](https://avatars.discourse-cdn.com/v4/letter/c/d07c76/32.png) [@chris.young36](https://cl.desmos.com/u/chris.young36)\
**Post date:** [December 1, 2019, 8:51am UTC](https://cl.desmos.com/t/colour-of-functions-and-points-on-the-graph-using-code-in-cl/634/1 "2019-12-01T08:51:21Z")

</div>

Is there a way to control the colour of a point or a function on a graph using CL (i.e. in code)?

What I want to do is change the colour of a point based on whether it is in the right place or not. I can use the “when” statement and can capture the x and y coordinates but I can’t seem to control the colour of the point.

Any thoughts?

Thanks

Chris

---

<div class="post-metadata">

**Author:** ![Werner\_Pries](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/werner_pries/32/129_2.png) [@Werner\_Pries](https://cl.desmos.com/u/Werner_Pries)\
**Post date:** [December 1, 2019, 3:31pm UTC](https://cl.desmos.com/t/colour-of-functions-and-points-on-the-graph-using-code-in-cl/634/2 "2019-12-01T15:31:05Z")

</div>

You can calculate correctness in graph, then show the point with the right colour based on that correctness. For example:

> **[Change Colours Based on Correctness in CL • Activity Builder by Desmos](https://teacher.desmos.com/activitybuilder/custom/5de3dad8693bb233826b35c9)**
>
> by Werner Pries
