Download the PHP package philiprehberger/php-color without Composer

On this page you can find all versions of the php package philiprehberger/php-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 php-color

PHP Color

Tests Latest Version on Packagist Last updated

Color parsing, conversion, manipulation, and WCAG contrast checking.

Requirements

Installation

Usage

Creating Colors

Converting Colors

Manipulating Colors

All manipulation methods return new Color instances (immutable).

Blending Colors

Color Analysis

WCAG Contrast Checking

Generating Palettes

Generating Gradients

API

Color

Method Description
Color::hex(string $hex): Color Create from hex string (3, 4, 6, or 8 digits)
Color::rgb(int $r, int $g, int $b, float $alpha = 1.0): Color Create from RGB values
Color::hsl(float $h, float $s, float $l, float $alpha = 1.0): Color Create from HSL values
Color::named(string $name): Color Create from CSS named color
Color::random(): Color Generate a random color
->lighten(float $percent): Color Lighten by percentage
->darken(float $percent): Color Darken by percentage
->saturate(float $percent): Color Increase saturation
->desaturate(float $percent): Color Decrease saturation
->mix(Color $other, float $weight = 0.5): Color Mix with another color
->blend(Color $other, string $mode): Color Blend with another color using a CSS blend mode
->invert(): Color Invert the color
->grayscale(): Color Convert to grayscale
->distance(Color $other): float CIE76 Delta E perceptual distance
->isLight(): bool True if relative luminance > 0.5
->isDark(): bool True if relative luminance <= 0.5
->contrastRatio(Color\|string $other): float WCAG contrast ratio (1.0-21.0)
->meetsWcagAA(Color\|string $background): bool Meets WCAG AA (4.5:1)
->meetsWcagAAA(Color\|string $background): bool Meets WCAG AAA (7:1)
->toHex(): string Output as hex string
->toRgb(): string Output as rgb()/rgba() string
->toHsl(): string Output as hsl()/hsla() string
->toArray(): array Output as associative array

Palette

Method Description
Palette::complementary(Color $color): array Complementary pair
Palette::analogous(Color $color, float $angle = 30.0): array Three analogous colors
Palette::triadic(Color $color): array Three triadic colors
Palette::splitComplementary(Color $color): array Split-complementary triad
Palette::tetradic(Color $color): array Tetradic (rectangular) quartet
Palette::gradient(Color $start, Color $end, int $steps, string $space = 'rgb'): array Interpolated color gradient
Palette::shades(Color $color, int $count = 5): array Progressive darker shades
Palette::tints(Color $color, int $count = 5): array Progressive lighter tints

Development

Support

If you find this project useful:

Star the repo

🐛 Report issues

💡 Suggest features

❤️ Sponsor development

🌐 All Open Source Projects

💻 GitHub Profile

🔗 LinkedIn Profile

License

MIT


All versions of php-color with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
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 philiprehberger/php-color contains the following files

Loading the files please wait ...