Is it possible to get the color of a pixel in a gradient element?

2

Imagine that I have a div element with the following CSS:

.minha-div{
    width:100px;height:100px;
    background:linear-grandient(45deg, orange, red);
}

Is it possible that when I hover over this div , it tells me the color of the pixel where the mouse is on, using JavaScript / jQuery?

I've already set the mouse position on the colored block, but I can not figure out how to get the color in that exact position.

Example of what has already been done: FIDDLE

    
asked by anonymous 02.06.2014 / 18:25

1 answer

1

With a query on some topics, I did not find any way to do this using only css + javascript, but I saw some examples using canvas. Here's an example on FIDDLE

Sources: link

link

    
03.06.2014 / 04:05