Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CLEANUP] spaces/newlines #3

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1285,23 +1285,23 @@ In **Couleur**, the `Css` color space refers to the **named colors** according
- **Dedicated functions** namespace : `matthieumastadenis\couleur\utils\hexRgb` ;
- **Accepted aliases** : `hex`, `hexrgb`, `hex-rgb`, `hex_rgb`, `hexadecimal` ;
- **Coordinates** : `red`, `green`, `blue` ;

### HSL

- **ColorSpace** case: `ColorSpace::Hsl` ;
- **Color class** : `matthieumastadenis\couleur\colors\Hsl` ;
- **Dedicated functions** namespace : `matthieumastadenis\couleur\utils\hsl` ;
- **Accepted aliases** : `hsl`, `hsla` ;
- **Coordinates** : `hue`, `saturation`, `lightness` ;

### HSV

- **ColorSpace** case: `ColorSpace::Hsv` ;
- **Color class** : `matthieumastadenis\couleur\colors\Hsv` ;
- **Dedicated functions** namespace : `matthieumastadenis\couleur\utils\hsv` ;
- **Accepted aliases** : `hsv`, `hsb` ;
- **Coordinates** : `hue`, `saturation`, `value` ;

### HWB

- **ColorSpace** case: `ColorSpace::Hwb` ;
Expand Down
14 changes: 7 additions & 7 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd"
backupGlobals="false"
bootstrap="vendor/autoload.php"
colors="true"
>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd"
backupGlobals="false"
bootstrap="vendor/autoload.php"
colors="true"
>
<coverage>
<include>
<directory suffix="Test.php">src/tests</directory>
Expand Down
58 changes: 29 additions & 29 deletions src/Color.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
use matthieumastadenis\couleur\colors\XyzD65;

/**
* An immutable object representing a color expressed in a precise and supported color space.
*
* An immutable object representing a color expressed in a precise and supported color space.
*
* It can be converted to another supported color space using one of the to...() methods.
* Variant instances can be created with the change() method.
*
* This class is abstract so it can not be instanciated directly.
* Variant instances can be created with the change() method.
*
* This class is abstract so it can not be instanciated directly.
* It is inherited by all classes in the matthieumastadenis\couleur\colors namespace.
*/
abstract class Color {
Expand All @@ -47,7 +47,7 @@ public function __toString(

/* #endregion */

/* #region Public Static Methods */
/* #region Public Static Methods */

/**
* Returns the ColorSpace instance corresponding to the current color.
Expand All @@ -62,7 +62,7 @@ public static function space(

/* #endregion */

/* #region Public Methods */
/* #region Public Methods */

/**
* Returns an array containing all coordinates of the current color.
Expand All @@ -85,15 +85,15 @@ public function stringify(

) :string {
return \implode(', ', $this->coordinates());
}
}

/**
* Returns a new ColorInterface instance corresponding to the current color converted into the $to color space.
*
* @param ColorSpace|\Stringable|string|null $to The desired output color space (can be an instance of the ColorSpace enum or a stringable alias)
* @param ColorInterface|null $fallback A ColorInterface instance used as a fallback in case of failure
* @param boolean|null $throw If false the method will not throw exceptions, $fallback will be returned instead
*
*
* @return ColorInterface The converted color object
*/
public function to(
Expand All @@ -115,7 +115,7 @@ public function to(
*
* @param Css|null $fallback A colors\Css instance used as a fallback in case of failure
* @param boolean|null $throw If false the method will not throw exceptions, $fallback will be returned instead
*
*
* @return Css The converted color object
*/
public function toCss(
Expand All @@ -134,7 +134,7 @@ public function toCss(
*
* @param HexRgb|null $fallback A colors\HexRgb instance used as a fallback in case of failure
* @param boolean|null $throw If false the method will not throw exceptions, $fallback will be returned instead
*
*
* @return HexRgb The converted color object
*/
public function toHexRgb(
Expand All @@ -153,7 +153,7 @@ public function toHexRgb(
*
* @param Hsl|null $fallback A colors\Hsl instance used as a fallback in case of failure
* @param boolean|null $throw If false the method will not throw exceptions, $fallback will be returned instead
*
*
* @return Hsl The converted color object
*/
public function toHsl(
Expand All @@ -172,7 +172,7 @@ public function toHsl(
*
* @param Hsv|null $fallback A colors\Hsv instance used as a fallback in case of failure
* @param boolean|null $throw If false the method will not throw exceptions, $fallback will be returned instead
*
*
* @return Hsv The converted color object
*/
public function toHsv(
Expand All @@ -191,7 +191,7 @@ public function toHsv(
*
* @param Hwb|null $fallback A colors\Hwb instance used as a fallback in case of failure
* @param boolean|null $throw If false the method will not throw exceptions, $fallback will be returned instead
*
*
* @return Hwb The converted color object
*/
public function toHwb(
Expand All @@ -210,7 +210,7 @@ public function toHwb(
*
* @param Lab|null $fallback A colors\Lab instance used as a fallback in case of failure
* @param boolean|null $throw If false the method will not throw exceptions, $fallback will be returned instead
*
*
* @return Lab The converted color object
*/
public function toLab(
Expand All @@ -229,7 +229,7 @@ public function toLab(
*
* @param Lch|null $fallback A colors\Lch instance used as a fallback in case of failure
* @param boolean|null $throw If false the method will not throw exceptions, $fallback will be returned instead
*
*
* @return Lch The converted color object
*/
public function toLch(
Expand All @@ -248,7 +248,7 @@ public function toLch(
*
* @param LinP3|null $fallback A colors\LinP3 instance used as a fallback in case of failure
* @param boolean|null $throw If false the method will not throw exceptions, $fallback will be returned instead
*
*
* @return LinP3 The converted color object
*/
public function toLinP3(
Expand All @@ -267,7 +267,7 @@ public function toLinP3(
*
* @param LinProPhoto|null $fallback A colors\LinProPhoto instance used as a fallback in case of failure
* @param boolean|null $throw If false the method will not throw exceptions, $fallback will be returned instead
*
*
* @return LinProPhoto The converted color object
*/
public function toLinProPhoto(
Expand All @@ -286,7 +286,7 @@ public function toLinProPhoto(
*
* @param LinRgb|null $fallback A colors\LinRgb instance used as a fallback in case of failure
* @param boolean|null $throw If false the method will not throw exceptions, $fallback will be returned instead
*
*
* @return LinRgb The converted color object
*/
public function toLinRgb(
Expand All @@ -305,7 +305,7 @@ public function toLinRgb(
*
* @param OkLab|null $fallback A colors\OkLab instance used as a fallback in case of failure
* @param boolean|null $throw If false the method will not throw exceptions, $fallback will be returned instead
*
*
* @return OkLab The converted color object
*/
public function toOkLab(
Expand All @@ -324,7 +324,7 @@ public function toOkLab(
*
* @param OkLch|null $fallback A colors\OkLch instance used as a fallback in case of failure
* @param boolean|null $throw If false the method will not throw exceptions, $fallback will be returned instead
*
*
* @return OkLch The converted color object
*/
public function toOkLch(
Expand All @@ -343,7 +343,7 @@ public function toOkLch(
*
* @param P3|null $fallback A colors\P3 instance used as a fallback in case of failure
* @param boolean|null $throw If false the method will not throw exceptions, $fallback will be returned instead
*
*
* @return P3 The converted color object
*/
public function toP3(
Expand All @@ -362,7 +362,7 @@ public function toP3(
*
* @param ProPhoto|null $fallback A colors\ProPhoto instance used as a fallback in case of failure
* @param boolean|null $throw If false the method will not throw exceptions, $fallback will be returned instead
*
*
* @return ProPhoto The converted color object
*/
public function toProPhoto(
Expand All @@ -381,7 +381,7 @@ public function toProPhoto(
*
* @param Rgb|null $fallback A colors\Rgb instance used as a fallback in case of failure
* @param boolean|null $throw If false the method will not throw exceptions, $fallback will be returned instead
*
*
* @return Rgb The converted color object
*/
public function toRgb(
Expand All @@ -400,7 +400,7 @@ public function toRgb(
*
* @param XyzD50|null $fallback A colors\XyzD50 instance used as a fallback in case of failure
* @param boolean|null $throw If false the method will not throw exceptions, $fallback will be returned instead
*
*
* @return XyzD50 The converted color object
*/
public function toXyzD50(
Expand All @@ -419,7 +419,7 @@ public function toXyzD50(
*
* @param XyzD65|null $fallback A colors\XyzD65 instance used as a fallback in case of failure
* @param boolean|null $throw If false the method will not throw exceptions, $fallback will be returned instead
*
*
* @return XyzD65 The converted color object
*/
public function toXyzD65(
Expand All @@ -434,5 +434,5 @@ public function toXyzD65(
}

/* #endregion */
}

}
Loading