public function getImageColor($rgb, $function)
    {
        $rgb = explode('|', $rgb);

        $red   = $rgb[0] ?? 0;
        $green = $rgb[1] ?? 0;
        $blue  = $rgb[2] ?? 0;
        $alpha = $rgb[3] ?? 0;

        return $function($this->canvas, $red, $green, $blue, $alpha);
    }