diff --git a/src/Colors/Cmyk/Color.php b/src/Colors/Cmyk/Color.php index e46cdb53..68c6e0db 100644 --- a/src/Colors/Cmyk/Color.php +++ b/src/Colors/Cmyk/Color.php @@ -17,6 +17,15 @@ use Intervention\Image\Interfaces\ColorspaceInterface; class Color extends AbstractColor { + /** + * Create new instance + * + * @param int $c + * @param int $m + * @param int $y + * @param int $k + * @return void + */ public function __construct(int $c, int $m, int $y, int $k) { /** @throws void */ @@ -28,6 +37,11 @@ class Color extends AbstractColor ]; } + /** + * {@inheritdoc} + * + * @see ColorInterface::create() + */ public static function create(mixed $input): ColorInterface { return (new class ([ @@ -37,40 +51,75 @@ class Color extends AbstractColor })->handle($input); } + /** + * {@inheritdoc} + * + * @see ColorInterface::colorspace() + */ public function colorspace(): ColorspaceInterface { return new Colorspace(); } + /** + * {@inheritdoc} + * + * @see ColorInterface::toHex() + */ public function toHex(string $prefix = ''): string { return $this->convertTo(RgbColorspace::class)->toHex($prefix); } + /** + * Return the CMYK cyan channel + * + * @return ColorChannelInterface + */ public function cyan(): ColorChannelInterface { /** @throws void */ return $this->channel(Cyan::class); } + /** + * Return the CMYK magenta channel + * + * @return ColorChannelInterface + */ public function magenta(): ColorChannelInterface { /** @throws void */ return $this->channel(Magenta::class); } + /** + * Return the CMYK yellow channel + * + * @return ColorChannelInterface + */ public function yellow(): ColorChannelInterface { /** @throws void */ return $this->channel(Yellow::class); } + /** + * Return the CMYK key channel + * + * @return ColorChannelInterface + */ public function key(): ColorChannelInterface { /** @throws void */ return $this->channel(Key::class); } + /** + * {@inheritdoc} + * + * @see ColorInterface::toString() + */ public function toString(): string { return sprintf( @@ -82,6 +131,11 @@ class Color extends AbstractColor ); } + /** + * {@inheritdoc} + * + * @see ColorInterface::isGreyscale() + */ public function isGreyscale(): bool { return 0 === array_sum([ @@ -91,6 +145,11 @@ class Color extends AbstractColor ]); } + /** + * {@inheritdoc} + * + * @see ColorInterface::isTransparent() + */ public function isTransparent(): bool { return false; diff --git a/src/Colors/Hsl/Color.php b/src/Colors/Hsl/Color.php index 2e3f5c0f..3cc1d433 100644 --- a/src/Colors/Hsl/Color.php +++ b/src/Colors/Hsl/Color.php @@ -26,6 +26,11 @@ class Color extends AbstractColor ]; } + /** + * {@inheritdoc} + * + * @see ColorInterface::colorspace() + */ public function colorspace(): ColorspaceInterface { return new Colorspace(); diff --git a/src/Colors/Hsv/Color.php b/src/Colors/Hsv/Color.php index f75f8a3b..e09a49b8 100644 --- a/src/Colors/Hsv/Color.php +++ b/src/Colors/Hsv/Color.php @@ -26,6 +26,11 @@ class Color extends AbstractColor ]; } + /** + * {@inheritdoc} + * + * @see ColorInterface::colorspace() + */ public function colorspace(): ColorspaceInterface { return new Colorspace(); diff --git a/src/Colors/Rgb/Channels/Alpha.php b/src/Colors/Rgb/Channels/Alpha.php index c37d4f6a..22439d1b 100644 --- a/src/Colors/Rgb/Channels/Alpha.php +++ b/src/Colors/Rgb/Channels/Alpha.php @@ -6,6 +6,11 @@ namespace Intervention\Image\Colors\Rgb\Channels; class Alpha extends Red { + /** + * {@inheritdoc} + * + * @see ColorChannelInterface::toString() + */ public function toString(): string { return strval(round($this->normalize(), 6)); diff --git a/src/Colors/Rgb/Color.php b/src/Colors/Rgb/Color.php index 6a4ac577..4473987f 100644 --- a/src/Colors/Rgb/Color.php +++ b/src/Colors/Rgb/Color.php @@ -36,6 +36,11 @@ class Color extends AbstractColor ]; } + /** + * {@inheritdoc} + * + * @see ColorInterface::colorspace() + */ public function colorspace(): ColorspaceInterface { return new Colorspace();