承接 kimitri/coltrane 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

kimitri/coltrane

Composer 安装命令:

composer require kimitri/coltrane

包简介

Coltrane is a command line utility to transform CSS (and SVG) colors between different representations. It supports transformations between Display P3, hex, hsl, hsla, rgb and rgba.

README 文档

README

Coltrane is a command line utility to transform CSS (and SVG) colors between different representations. It supports transformations between Display-P3 (with and without alpha), hex, hsl, hsla, rgb and rgba. Currently, it's one of the few tools that support the wide gamut Display-P3 colors.

Installation

Coltrane is written in PHP and can be installed using Composer: composer global require kimitri/coltrane

After this the coltrane executable is installed in the Composer binary directory (typically ~/.composer/vendor/bin). Make sure that directory is included in your $PATH.

Usage

Coltrane is designed to be integrated into various automated workflows and therefore works great in a wide variety of use cases. By default Coltrane reads its input from stdin and outputs to stdout but you can use plain old files by specifying the --infile and --outfile (-i and -o) options.

Palette alignment

Coltrane also provides a handy palette alignment function and a bunch of built-in palettes. Palette is specified using the --palette (-p) option and palettes are simple text files consisting of regular hex colors (one color per line) without the preceding # character. This format is supported by the Lospec website (.HEX files). To use a custom palette, just give the --palette option the path to your palette file.

Coltrane comes with a bunch of retro themed palettes from the Lospec website. These built-in palettes can be listed by running coltrane palettes. To use a built-in palette, just give the --palette option the name of the built-in palette.

Alpha channel

Some color formats (in Coltrane's case these are display-p3a, hsla and rgba) support alpha channels and Coltrane provides a few ways to specify target alpha values. Alpha values range from 0 (fully transparent) to 1 (fully opaque). Alpha can be set using the --alpha (-a) option and there are two different modes of operation:

  • Use a static alpha value (e.g. --alpha .8 to use alpha value of 0.80).
  • Map alpha to the R, G, B or alpha channel of the input color (e.g. --alpha r to use the relative red channel value as alpha). Please note that R, G and B channels are also used with hsla colors. (Alpha channel handling was changed in version 1.2.0 and the original alpha is now preserved by default.)

Usage examples

  1. Read a CSS file with colors defined as hexadecimal values and output the same CSS with colors transformed into wide gamut Display-P3: coltrane hex2display-p3 -i source.css -o wide-gamut.css
  2. Take a CSS string from the macOS clipboard, transform all colors defined as rgb() into wide gamut Display-P3 and store the resulting CSS back to clipboard: pbpaste | coltrane rgb2display-p3 | pbcopy
  3. Take a CSS string from the macOS clipboard, transform all colors defined as hexadecimal values into rgba() using the original alpha value of the input color, align them to the classic CGA palette and write the resulting CSS into a file: pbpaste | coltrane hex2rgba -a a -p cga1-hi -o cga-is-still-cool.css

kimitri/coltrane 适用场景与选型建议

kimitri/coltrane 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 16 次下载、GitHub Stars 达 0, 最近一次更新时间为 2022 年 01 月 22 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 kimitri/coltrane 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 kimitri/coltrane 我们能提供哪些服务?
定制开发 / 二次开发

基于 kimitri/coltrane 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 16
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 18
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-01-22