Download the PHP package mateffy/color without Composer
On this page you can find all versions of the php package mateffy/color. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mateffy/color
More information about mateffy/color
Files in mateffy/color
Package color
Short Description A utility package for working with colors, including manipulation, conversion and formatting.
License MIT
Informations about the package color
mateffy/color
A powerful color manipulation library for PHP / Laravel with a focus on DX and simplicity with great support for Tailwind and Filament color definitions.
Features
- 🎨 Manipulate your colors with
hue
,lighten
,alpha
and similar methods - 💅 Format your colors as Hex, RGB, HSL and more
- 👨💻 Fully typed and documented, developer focused API
- ✨ Generate new
50
->950
color palettes from a single color - 🔩 Natively supports Tailwind and Filament color definitions
Installation
Usage
Working with Colors
Creating Colors
You can create color instances using various methods:
Modifying Colors
Once you have a color instance, you can modify it using various methods:
Outputting Colors
You can output colors in various formats:
Working with Shades
Shades are variations of a single color, typically ranging from very light to very dark. In this library, shades are represented as a collection of colors, usually including 11 variations labeled from 50 (lightest) to 950 (darkest), with 500 being the base color. They are a key component in design systems like Tailwind CSS and Filament, which use predefined shade palettes for their color schemes.
This library proivides the Shades
class, which contains a variety of methods for working with shades in a type-safe and fluent way.
Creating Shades
You can create shades using predefined color palettes or generate them from a single color:
When you generate shades from a single color, the library automatically creates a range of lighter and darker variations, giving you a full palette to work with. This is particularly useful when you need to create a custom color scheme based on a specific brand color.
Accessing Shades
You can access individual shades using either object properties or array syntax:
Outputting Shades
You can output all shades or individual shades in various formats:
Changelog
- 1.0.0
- Initial release