Color picker (in game)

Color picker?
How can I make the color picker

(example) for some sprites in my game (eg car doors)

Hi @Yigit_Alp_CORTUK,

You can use any HTML/CSS/JS color picker library with PlayCanvas. I was about to say use the PCUI library, but I think the color picker isn’t exposed there yet.

Here is a nice one:

Thank you.

Sorry to bump such an old thread, but is it possible to use this color picker in the 3D canvas??, for example, I would want to pick the pixel color of a textured geometry, and assign that color to the emissive channel of a material.

Thanks in advance!

Hmmm… I’ve got some ideas, none of which I’ve done before or really know how to do offhand.

  • Ray cast to a mesh, convert the space to texture UV and grab it from the texture on the material on the mesh instance
  • Somehow grab the colour buffer from the rendering and get the pixel colour there
  • Take a render texture of the scene and get the pixel colour there

Playcanvas uses webgl2 as context removes the data from the buffer (preserveDrawingBuffer=false)