/** * Get Q from RGB in YIQ color model * * @param \Sokil\Image\ColorModel\Rgb $rgb * @return int Q */ public static function getQFromRgb(Rgb $rgb) { return floor($rgb->getRed() * 0.211 - $rgb->getGreen() * 0.522 + $rgb->getBlue() * 0.311); }