Get colour of mouse ray hitposition?

Hello there.

I want to put on my scene a colour palette texture, and i want to somehow get the color that the mouse is pointing at to apply on another object.

If it’s not possible to do this with a texture, at least i want to get the colour of the face (not the vertex) on the mouse ray hitposition.

Thanks

Use Tkinter

from Rasterizer import showMouse
from Tkinter import *
import tkColorChooser
 
cont = GameLogic.getCurrentController()
sens = cont.sensors['sensor']

showMouse(1)
if sens.positive:
	root = Tk()
	color = tkColorChooser.askcolor()
	print color
	root.destroy()

This code returns RGB and HEX value of the selected color

Thanks. But it’s not exactly what I want. Anyways, i just had a better idea. I’m gonna make a colorpicker that runs inside BGE. It’s easy to do it using the colorsys :D. It’s not a good deal to call external resources imho.

Thank you.