Simple js script for detecting opaque color by result color and opacity