ypho/colors

Colors is a small package that contains 22 color palettes. Each palette has ten shades from light to dark.

1.1.1 2022-01-05 08:54 UTC

This package is auto-updated.

Last update: 2024-09-05 17:06:41 UTC


README

License GitHub Workflow Status Code Size Latest Release

Colors is a small package that contains 22 color palettes. Each palette has ten shades from light to dark. The colors are based on the TailwindCSS colors.

Installation

composer require ypho/colors

Usage

// Return given color
$regularRed = Color::getSingleColor('red'); // #ef4444

// Return given color, but a darker shade of red
$amazonGreen = Color::getSingleColor('green', 8); // #166534

// Returns a palette of 10 shades of the given color
$teal = Color::getColorPalette('teal'); // ['#f0fdfa' ... '#134e4a']

// Returns all colors, in a light shade
$lightColors = Color::getColorsByShade(2); // ['#e2e8f0' ... '#fecdd3']

// Same as above, but take only three colors
$trafficLight = Color::getColorsByShade(6, ['red', 'orange', 'green']); // ['#dc2626', '#f97316', '#22c55e']

Donations

BTC ETH