Download the PHP package intellexapps/color without Composer

On this page you can find all versions of the php package intellexapps/color. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package color

Color manipulation for PHP

Predefined colors

The list of all 142 standardized HTML colors defined in Predefined\RGBA class:

A couple of examples

From hex to CSS:

From CSS to GD color:

From CMYK to RGBA:

Conversion

When initialize a color will either be RGBA or CMYK. This can be done manually, or by parsing the string.

Note that some parameters (ie. alpha channel in RGBA), will simply be ignored during conversion.

Any color can be cast to another one:

Example with a parser.

Output

Options available for RGBA:

Options available for CMYK:

Parsing a color

Use ColorParser::parse($input), which will try every registered parser.

If no parser is able to handle it, ColorCannotBeParsed will be thrown.

Default parsers support most (if not all) RGBA and CMYK formats, but you can create you custom parsers for your specific need.

Supported out of the box:

Custom parsers

Create and register a new parsers, that will ba included in the next parsing:

  1. Create a class and implement AbstractColorParser interface.
  2. When implementing method parse($input)
    • if input cannot be parsed -> throw ColorCannotBeParsed
    • if input can be parsed return the Color
  3. Register the parser with ColorParser::registerParser(AbstractColorParser $parser).
  4. Next time the ColorParser::parse() is called, your parser will be considered as well.

TODO

  1. Support for HSV.
  2. Detect color name by finding the most similar color in the predefined list.

Credits

Script has been written by the Intellex team.


All versions of color with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package intellexapps/color contains the following files

Loading the files please wait ....