ControlP5 library, textfield cursor colour

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.:thinking::thinking:
I really need your help!
Thanks in advance!!:slight_smile:

Yordan

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

1 Like

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

1 Like

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

3 Likes

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

Thanks for the reply!:slight_smile:
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.

Thanks for the fast reply! :slight_smile:
setColorCursor() works great. It solved the problem. :clap: :clap: :clap:
Thanks again.
Best wishes,

Yordan

1 Like