Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
johanrosenson committed Sep 13, 2021
1 parent d4b0ced commit 86a85a2
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,15 @@ use Devlop\Colours\RgbColor;
$rgbColor = new RgbColor(221, 186, 146);

// creating from other formats
$rgbColor = HslColor::fromHexString('#f3840c');
$rgbColor = HslColor::fromHexColor($hexColorInstance);
$rgbColor = HslColor::fromHslColor($hslColorInstance);
$cmykColor = HslColor::fromCmykColor($cmykColorInstance);
$rgbColor = RgbColor::fromHexString('#f3840c');
$rgbColor = RgbColor::fromHexColor($hexColorInstance);
$rgbColor = RgbColor::fromHslColor($hslColorInstance);
$cmykColor = RgbColor::fromCmykColor($cmykColorInstance);

// get RGB properties
$rgbColor->getRed(); // int(221)
$rgbColor->getSaturation(); // int(186)
$rgbColor->getLightness(); // int(146)
$rgbColor->getGreen(); // int(186)
$rgbColor->getBlue(); // int(146)

// converting to other formats
$hexColor = $rgbColor->toHex();
Expand All @@ -106,9 +106,9 @@ use Devlop\Colours\CmykColor;
$rgbColor = new CmykColor(20, 80, 65, 34);

// creating from other formats
$cmykColor = HslColor::fromHexString('#f3840c');
$cmykColor = HslColor::fromHexColor($hexColorInstance);
$cmykColor = HslColor::fromRgbColor($rgbColorInstance);
$cmykColor = CmykColor::fromHexString('#f3840c');
$cmykColor = CmykColor::fromHexColor($hexColorInstance);
$cmykColor = CmykColor::fromRgbColor($rgbColorInstance);

// get CMYK properties
$rgbColor->getCyan(); // int(20)
Expand Down

0 comments on commit 86a85a2

Please sign in to comment.