public function getMaxContrastColor() { $lum = $this->toLuminosity(); $color = new Jetpack_Color(); $hex = $lum >= 0.5 ? '000000' : 'ffffff'; return $color->fromHex($hex); }
public function getMaxContrastColor() { $withBlack = $this->getDistanceLuminosityFrom(new Jetpack_Color('#000')); $withWhite = $this->getDistanceLuminosityFrom(new Jetpack_Color('#fff')); $color = new Jetpack_Color(); $hex = $withBlack >= $withWhite ? '#000000' : '#ffffff'; return $color->fromHex($hex); }