Changing colour of stem online in response to keys

How do I change the colour of a photo according to what the participant presses, ideally rotating the colour in a 360 degree circle? I’ve seen various people talking about how to do this but no solution - is it possible to do online? thanks

What color space are you trying to use to change the photo? Could you tell us more about the approach that you have tried already?

I’d like to use Lab colour space to change the colour. So I would ideally convert the rgb value to LAB, rotate in LAB, then convert back to RGB and display using e.g. imageStim.color = (x,y,z). Is this possible?

I haven’t personally worked with LAB color space - but do you have the equations for conversion?