# ControlP5 library, textfield cursor colour

**URL:** <https://discourse.processing.org/t/controlp5-library-textfield-cursor-colour/2321>\
**Category:** Libraries\
**Created:** [August 2, 2018, 8:42pm UTC](https://discourse.processing.org/t/controlp5-library-textfield-cursor-colour/2321 "2018-08-02T20:42:51Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jormil1](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jormil1/32/990_2.png) [@jormil1](https://discourse.processing.org/u/jormil1)\
**Post date:** [August 2, 2018, 8:42pm UTC](https://discourse.processing.org/t/controlp5-library-textfield-cursor-colour/2321/1 "2018-08-02T20:42:51Z")

</div>

Hello! I’m new to cp5 lib and processing at all, but I work on a project from about a month and today I faced a problem and can’t find anyone with the same in the forum. I couldn’t figure out how to change the textfield cursor’s colour.🤔🤔  
I really need your help!  
Thanks in advance!!🙂

Yordan

---

<div class="post-metadata">

**Author:** ![tony](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/tony/32/949_2.png) [@tony](https://discourse.processing.org/u/tony)\
**Post date:** [August 2, 2018, 10:44pm UTC](https://discourse.processing.org/t/controlp5-library-textfield-cursor-colour/2321/2 "2018-08-02T22:44:15Z")

</div>

Taking a step back, can I ask why you want to change the color of the cursor?

---

<div class="post-metadata">

**Author:** ![kfrajer](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kfrajer/32/196_2.png) [@kfrajer](https://discourse.processing.org/u/kfrajer)\
**Post date:** [August 3, 2018, 1:09am UTC](https://discourse.processing.org/t/controlp5-library-textfield-cursor-colour/2321/3 "2018-08-03T01:09:14Z")

</div>

> [@jormil1](#):
>
> I couldn’t figure out how to change the textfield cursor’s colour

Not sure if cp5 exposes any methods to customize the caret’s color. Did you explore all the function calls associated to the cp5 element that you want to change? I suggest you provide some code demonstrating what you want to change. No need to provide your actual source code. It is better if you use a small code base, an mcve.

Kf

---

<div class="post-metadata">

**Author:** ![jb4x](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jb4x/32/789_2.png) [@jb4x](https://discourse.processing.org/u/jb4x)\
**Post date:** [August 3, 2018, 6:29am UTC](https://discourse.processing.org/t/controlp5-library-textfield-cursor-colour/2321/4 "2018-08-03T06:29:52Z")

</div>

There is a `setColorCursor()` function. Check the doc:  
[http://www.sojamo.de/libraries/controlP5/reference/index.html](http://www.sojamo.de/libraries/controlP5/reference/index.html)

---

<div class="post-metadata">

**Author:** ![jormil1](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jormil1/32/990_2.png) [@jormil1](https://discourse.processing.org/u/jormil1)\
**Post date:** [August 3, 2018, 8:00am UTC](https://discourse.processing.org/t/controlp5-library-textfield-cursor-colour/2321/5 "2018-08-03T08:00:19Z")

</div>

Thanks for the fast reply! 🙂  
I used these functions:  
**.setColor(#FF3333)**  
**.setColorActive(#FFFFFF)**  
**.setColorBackground(#FFFFFF)**  
**.setColorForeground(#FFFFFF)**  
but I didn’t find there was a **setColorCursor()** function. 🤦‍♂️  
So, problem fixed! Thanks again for the fast reply! 🙂

---

<div class="post-metadata">

**Author:** ![jormil1](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jormil1/32/990_2.png) [@jormil1](https://discourse.processing.org/u/jormil1)\
**Post date:** [August 3, 2018, 8:05am UTC](https://discourse.processing.org/t/controlp5-library-textfield-cursor-colour/2321/6 "2018-08-03T08:05:52Z")

</div>

Thanks for the reply!🙂  
I was trying to change it because it was the same colour as the textfield’s and it was like I don’t have a cursor.  
However, @jb4x suggested setColorCursor() function and it works.

---

<div class="post-metadata">

**Author:** ![jormil1](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jormil1/32/990_2.png) [@jormil1](https://discourse.processing.org/u/jormil1)\
**Post date:** [August 3, 2018, 8:11am UTC](https://discourse.processing.org/t/controlp5-library-textfield-cursor-colour/2321/7 "2018-08-03T08:11:21Z")

</div>

Thanks for the fast reply! 🙂  
setColorCursor() works great. It solved the problem. 👏 👏 👏  
Thanks again.  
Best wishes,

Yordan
