decodelabs/spectrum
最新稳定版本:v0.3.8
Composer 安装命令:
composer require decodelabs/spectrum
包简介
Bring colour to PHP
README 文档
README
Parse and manipulate colors
Spectrum offers a simple but powerful system for parsing, inspecting, manipulating and exporting colors.
Installation
This package requires PHP 8.4 or higher.
Install via Composer:
composer require decodelabs/spectrum
Usage
Load and manipulate any color with ease through RGB, HSL and HSV formats.
use DecodeLabs\Spectrum\Color; $color = Color::create('#5AB3CD'); $color = Color::create('darkblue'); $color = Color::create('rgba(25,25,25,0.4)'); $color = Color::random(); $color->toHsl(); $color->lighten(0.3); // 30% lighter $color->setAlpha(0.5); // 50% opacity $color->toMidtone(); // Medium saturation and lightness echo $color; // Converts to appropriate CSS value $contrastColor = $color->contrastAgainst('pink'); $textColor = $color->getTextContrastColor();
Licensing
Spectrum is licensed under the MIT License. See LICENSE for the full license text.
统计信息
- 总下载量: 1.41k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 1
其他信息
- 授权协议: MIT
- 更新时间: 2021-04-12