Beispiel #1
0
 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);
 }
Beispiel #2
0
 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);
 }