Download the PHP package phpexperts/color-speaker without Composer
On this page you can find all versions of the php package phpexperts/color-speaker. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download phpexperts/color-speaker
More information about phpexperts/color-speaker
Files in phpexperts/color-speaker
Package color-speaker
Short Description An easy-to-use converter for different types of color models.
License MIT
Homepage https://www.phpexperts.pro/
Informations about the package color-speaker
ColorSpeaker
ColorSpeaker is a PHP Experts, Inc., Project is an easy-to-use converter for different types of color models.
It aims to support all major color models: RGB, CSS hex codes, HSL and HSV.
Installation
Via Composer
Usage
Initialize it with 3 standard RGB integers:
It can easily be used as a string for css-compatible output:
You can also fetch the RGBColor and the HexColor directly:
See the SimpleDTO Project for more.
You can also export to different color formats:
All colors serializable and easily converted to JSON objects:
Use cases
PHPExperts\ColorSpeaker\ColorSpeaker
✔ Can be constructed from an RGBColor
✔ Can be constructed from a HexColor
✔ Can be constructed from an HSLColor
✔ From RGB: Will only accept integers between 0 and 255, inclusive
✔ From CSS Hex: Will only accept a valid 3 or 6 digit Hex color string,
starting with a "#" sign
✔ Can return an RGBColor
✔ Can return a CSSHexColor
✔ Can return an HSLColor
✔ Can be outputted as a CSS string
PHPExperts\ColorSpeaker\DTOs\RGBColor
✔ Will only accept integers between 0 and 255, inclusive
✔ Will only accept literal integers
✔ Can be constructed with a zero-indexed array
✔ Can be outputted as a CSS string
PHPExperts\ColorSpeaker\DTOs\CSSHexColor
✔ Can assert if a string is a valid CSS hex color
✔ The hex code must start with a "#" sign
✔ Will only accept three digit and six digit hex codes
✔ Can be outputted as a CSS string
PHPExperts\ColorSpeaker\DTOs\HSLColor
✔ Will only accept a valid HSL geometry of percentages or percent-integers
✔ Can be constructed with a zero-indexed array
✔ Can be constructed with integers
✔ Can be outputted as a CSS string
Testing
Contributors
Theodore R. Smith [email protected]
GPG Fingerprint: 4BF8 2613 1C34 87AC D28F 2AD8 EB24 A91D D612 5690
CEO: PHP Experts, Inc.
A big shoutout to https://www.w3schools.com/colors/colors_converter.asp. That wonderful color converter made this project's development 70% easier!
License
MIT license. Please see the license file for more information.