@@ -23,6 +23,7 @@ private function __construct(
2323 *
2424 * @param int<0, 255> $value
2525 */
26+ #[\NoDiscard]
2627 public static function at (int $ value ): self
2728 {
2829 return new self ($ value );
@@ -33,6 +34,7 @@ public static function at(int $value): self
3334 *
3435 * @return Attempt<self>
3536 */
37+ #[\NoDiscard]
3638 public static function of (int $ value ): Attempt
3739 {
3840 if ($ value < 0 || $ value > 255 ) {
@@ -47,6 +49,7 @@ public static function of(int $value): Attempt
4749 *
4850 * @return Attempt<self>
4951 */
52+ #[\NoDiscard]
5053 public static function fromHexadecimal (string $ hex ): Attempt
5154 {
5255 if (\mb_strlen ($ hex ) === 1 ) {
@@ -59,13 +62,15 @@ public static function fromHexadecimal(string $hex): Attempt
5962 /**
6063 * @return Attempt<self>
6164 */
65+ #[\NoDiscard]
6266 public static function fromIntensity (Intensity $ intensity ): Attempt
6367 {
6468 return self ::of (
6569 (int ) \round ((255 * $ intensity ->toInt ()) / 100 ),
6670 );
6771 }
6872
73+ #[\NoDiscard]
6974 public function add (self $ blue ): self
7075 {
7176 return new self (
@@ -76,6 +81,7 @@ public function add(self $blue): self
7681 );
7782 }
7883
84+ #[\NoDiscard]
7985 public function subtract (self $ blue ): self
8086 {
8187 return new self (
@@ -86,16 +92,19 @@ public function subtract(self $blue): self
8692 );
8793 }
8894
95+ #[\NoDiscard]
8996 public function equals (self $ blue ): bool
9097 {
9198 return $ this ->integer === $ blue ->toInt ();
9299 }
93100
101+ #[\NoDiscard]
94102 public function atMaximum (): bool
95103 {
96104 return $ this ->integer === 255 ;
97105 }
98106
107+ #[\NoDiscard]
99108 public function atMinimum (): bool
100109 {
101110 return $ this ->integer === 0 ;
@@ -104,11 +113,13 @@ public function atMinimum(): bool
104113 /**
105114 * @return int<0, 255>
106115 */
116+ #[\NoDiscard]
107117 public function toInt (): int
108118 {
109119 return $ this ->integer ;
110120 }
111121
122+ #[\NoDiscard]
112123 public function toString (): string
113124 {
114125 return \str_pad (
0 commit comments