bitandblack/colors
Composer 安装命令:
composer require bitandblack/colors
包简介
Handle colors and their systems easily. Based on Adobe InDesigns color books.
关键字:
README 文档
README
Colors
Handle colors and their systems easily. Based on Adobe InDesigns color books. Included libraries are:
- HKS E Process
- HKS E
- HKS K Process
- HKS K
- HKS N Process
- HKS N
- HKS Z Process
- HKS Z
- PANTONE+ CMYK Coated
- PANTONE+ CMYK Uncoated
- PANTONE+ Color Bridge Coated
- PANTONE+ Color Bridge Uncoated
- PANTONE+ Metallic Coated
- PANTONE+ Pastels + Neons Coated
- PANTONE+ Pastels + Neons Uncoated
- PANTONE+ Premium Metallics Coated
- PANTONE+ Solid Coated
- PANTONE+ Solid Uncoated
- RAL
Attention
This repository is meant to get values of PANTONE, HEX or RAL colors. The conversion into other systems isn't 100% perfect, because there are different methods to convert from one system into another. Don't take these values too serious.
Installation
This library is made for the use with Composer. Add it to your project by running $ composer require bitandblack/colors.
Usage
You can use color values or color systems, depending on your needs.
Color values in different color systems
Set up a color like that:
<?php
use Color\Value\CMYK;
$red = new CMYK(0, 100, 90, 0);
Or when the color is based on a library:
<?php
use Color\Value\PANTONE as PANTONEValue;
use Color\System\PANTONE as PANTONESystem;
use Color\System\Enum\PANTONE as PANTONEEnum;
$pantoneSolidCoated = new PANTONESystem(
PANTONEEnum::PANTONE_PLUS_SOLID_COATED()
);
$red = new PANTONEValue('200', $pantoneSolidCoated);
Available color systems are:
CIELabCMYCMYKHEXHKSHSLHSLAPANTONERALRGBRGBAXYZ
Get values from another color system by calling
<?php
$sameRedDifferentValue = $red->getRGB();
Color systems and similar values
In the color systems of PANTONE, HKS and RAL you can find (similar) colors based on RGB, HEX or CMYK values by calling
<?php
use Color\Value\CMYK as CMYKValue;
use Color\System\PANTONE as PANTONESystem;
use Color\System\Enum\PANTONE as PANTONEEnum;
$pantoneSolidCoated = new PANTONESystem(
PANTONEEnum::PANTONE_PLUS_SOLID_COATED()
);
$red = new CMYKValue(0, 100, 90, 0);
$redsInPantone = $pantoneSolidCoated->findColor($red, 0);
The second parameter in findColor() defines the tolerance in percent. For example 0 returns only a 100% match and 5 allows to return colors that differ about 5% in every single color value.
Complementary color
You can get the complementary color by calling getComplementary(). This will return a HSL color which you can convert as usual into other systems.
Help
If you have any questions, feel free to contact us under hello@bitandblack.com.
Further information about Bit&Black can be found under www.bitandblack.com.
bitandblack/colors 适用场景与选型建议
bitandblack/colors 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 147.29k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2019 年 07 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「color」 「adobe」 「rgb」 「cmyk」 「hsl」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 bitandblack/colors 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 bitandblack/colors 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 bitandblack/colors 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Native (browser) color input field for SilverStripe
Colorizes the Flarum forum header and interface based on the active tag's color.
Laravel MPdf : Easily generate PDF files with arabic support
Writes an Adobe IDML file out of a given content
Adds configurable custom fees to orders
Color conversion library
统计信息
- 总下载量: 147.29k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 28
- 依赖项目数: 4
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-07-05