public static function bestColor(ColorJizz $color, array $options = array()) { if (isset(static::$data['bestColor'])) { return call_user_func(static::$data['bestColor'], $color, $options); } return parent::bestColor($color, $options); }
public function testBestColorWithLowestColorBeingBlack() { $color = new ColorJizzStub(); $color->data['distance'] = function ($destinationColor) { if ($destinationColor->toHEX()->__toString() === '000000') { return 1; } return 10; }; $bestColor = Color::bestColor($color); $this->assertSame('black', $bestColor); }