How to check for specific pattern in canvas with JavaScript

I have a png with a specific pattern on it, which for the example is a 30x30 square colored #FF00DC. Is there any way I could get the position of the square in the image ? The pattern could be anywhere on the image but will have the same size and color, whereas the image could be any color.

pattern in image

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum