Hello. I want to learn something about getting pixels' colors where under the mouse cursor position. I need it to return the RGB value of the color of where my mouse is on and then retrieving the value corresponding to this RGB (as a key) with the dictionary.
First step I need to get the color of pixels where my mouse's position is. So I use:
> var mouse_position =get_viewpoint().get_mouse_position
> var mouse_position_color =get_pixel ( int (mouse_position.x), int (mouse_position).y )
> print(mous_position)
> print(mous_position_color)
By doing this, I get the value of variable "mouse_position_color" in floating point decimal form, e.g. (0.01000, 0.4004, 0.6555, 1). Personally, I'm uncomfortable with this form of expression, I'd like it to be expressed as an integer value from 0 to 255, such as (100, 125, 218, 1).
Can someone tell me how to achieve it? Thank you all very much.