public static function getColorIndex($red, $green, $blue, $sigBits = self::SIGBITS) { return ($red << 2 * $sigBits) + ($green << $sigBits) + $blue; }
/** * @dataProvider provide5bitsColorIndex */ public function testGetColorIndex5bits($r, $g, $b, $index) { $this->assertSame($index, ColorThief::getColorIndex($r, $g, $b)); }