# Make a point change color when click on it

**URL:** <https://cl.desmos.com/t/make-a-point-change-color-when-click-on-it/8004>\
**Category:** Questions\
**Created:** [June 20, 2025, 12:25pm UTC](https://cl.desmos.com/t/make-a-point-change-color-when-click-on-it/8004 "2025-06-20T12:25:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![par2386](https://avatars.discourse-cdn.com/v4/letter/p/b5e925/32.png) [@par2386](https://cl.desmos.com/u/par2386)\
**Post date:** [June 20, 2025, 12:25pm UTC](https://cl.desmos.com/t/make-a-point-change-color-when-click-on-it/8004/1 "2025-06-20T12:25:22Z")

</div>

Hi, I am trying to make an activity so the users can click on the corners of a pyramid to count them. The pyramid is visible and the user clicks on one corner the point appears on this place. Any suggestions?

---

<div class="post-metadata">

**Author:** ![SteinSchreiber](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/steinschreiber/32/2267_2.png) [@SteinSchreiber](https://cl.desmos.com/u/SteinSchreiber)\
**Post date:** [June 20, 2025, 12:44pm UTC](https://cl.desmos.com/t/make-a-point-change-color-when-click-on-it/8004/2 "2025-06-20T12:44:26Z")

</div>

Not sure if this would be useful, but was a way I approached a similar problem.

> **[Click Color Dot • Activity Builder by Desmos Classroom](https://teacher.desmos.com/activitybuilder/custom/6596146ac8e3a03beb9bd044?utm_campaign=share&utm_content=activity)**
>
> by Stein Schreiber

---

<div class="post-metadata">

**Author:** ![par2386](https://avatars.discourse-cdn.com/v4/letter/p/b5e925/32.png) [@par2386](https://cl.desmos.com/u/par2386)\
**Post date:** [June 20, 2025, 1:17pm UTC](https://cl.desmos.com/t/make-a-point-change-color-when-click-on-it/8004/3 "2025-06-20T13:17:31Z")

</div>

Yes this is what I was trying to do. 🙂 How did you manage to do that?

---

<div class="post-metadata">

**Author:** ![SteinSchreiber](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/steinschreiber/32/2267_2.png) [@SteinSchreiber](https://cl.desmos.com/u/SteinSchreiber)\
**Post date:** [June 20, 2025, 1:32pm UTC](https://cl.desmos.com/t/make-a-point-change-color-when-click-on-it/8004/4 "2025-06-20T13:32:37Z")

</div>

It uses the “actions” feature in the desmos calculator. Here is the documentation on that feature: [https://help.desmos.com/hc/en-us/articles/4407725009165-Actions#h\_01FB2RRQ5ZHN6Q66WWWK545SGY](https://help.desmos.com/hc/en-us/articles/4407725009165-Actions#h_01FB2RRQ5ZHN6Q66WWWK545SGY)

---

<div class="post-metadata">

**Author:** ![Daniel\_Grubbs](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/daniel_grubbs/32/719_2.png) [@Daniel\_Grubbs](https://cl.desmos.com/u/Daniel_Grubbs)\
**Post date:** [June 20, 2025, 1:59pm UTC](https://cl.desmos.com/t/make-a-point-change-color-when-click-on-it/8004/5 "2025-06-20T13:59:44Z")

</div>

The above can get a little unwieldy as you’ll need individual actions for each point. As an alternative you can define dynamically changing colors and point sizes (“Single point” folder), but I also made some actions that work for lists of points.

> **[Desmos | Graphing Calculator](https://www.desmos.com/calculator/dp384lhfnge)**
>
> Explore math with our beautiful, free online graphing calculator. Graph functions, plot points, visualize algebraic equations, add sliders, animate graphs, and more.

---

<div class="post-metadata">

**Author:** ![NTMDev](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/ntmdev/32/7141_2.png) [@NTMDev](https://cl.desmos.com/u/NTMDev)\
**Post date:** [June 20, 2025, 6:27pm UTC](https://cl.desmos.com/t/make-a-point-change-color-when-click-on-it/8004/6 "2025-06-20T18:27:05Z")

</div>

Do something like:  
`button onclick: c_hangecolor`  
`a = 0`  
`c_hangecolor = a -> a + 1 {a < 3}, a -> 0 {a = 3}`  
`c_olors = [rgb(255,0,0), rgb(0,255,0), rgb(0,0,255)]`  
`c_urrentcolor = c_olors[a]`  
`p_oint = (0,0) color: c_urrentcolor`

(not sure if this will work I just did it off the top of my head)
