定制 chernegasergiy/color-converter 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

chernegasergiy/color-converter

最新稳定版本:v1.0.0

Composer 安装命令:

composer create-project chernegasergiy/color-converter

包简介

A simple PHP color converter CLI application.

README 文档

README

Latest Stable Version Total Downloads License

A standalone, interactive command-line tool for converting color models, written in pure PHP.

Features

  • Multiple Conversion Modes: Convert between the following color models:
    • RGB ↔ CMYK
    • RGB ↔ HSV
    • RGB ↔ HSL
    • RGB ↔ Lab
    • RGB ↔ YCbCr
    • RGB → All formats (one-click conversion to all supported models)
  • Interactive UI: A fully interactive, menu-driven interface that runs directly in your terminal.
  • Live Previews: See a preview of the color swatch in your terminal as you select values.
  • Slider Input: Use arrow keys to intuitively adjust color values with a visual slider.
  • Conversion History: Keeps a running history of your recent color conversions.
  • Zero Dependencies: A single script that runs without any external libraries or Composer packages.

How to Run

  1. Ensure you have PHP installed.
  2. Run the script from your terminal:
    php converter.php

Supported Conversions

The tool supports the following direct conversions in both directions (unless otherwise noted):

  • RGB → CMYK and CMYK → RGB
  • RGB → HSV and HSV → RGB
  • RGB → HSL and HSL → RGB
  • RGB → Lab and Lab → RGB
  • RGB → YCbCr and YCbCr → RGB
  • RGB → All formats: Quickly convert RGB to all other supported models in a single operation

Usage

This tool provides a simple, guided workflow for color conversion. First, run the script to see the main menu where you can select the desired conversion type.

Main Menu

Next, use the arrow keys to adjust the color values with the interactive slider. The terminal shows a live preview of the color as you make changes.

Color Selection with Slider

After confirming your input, the script will display the final conversion result.

Conversion Result

Contributing

Contributions are welcome and appreciated! Here's how you can contribute:

  1. Fork the project
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Please make sure to update tests as appropriate and adhere to the existing coding style.

License

This project is licensed under the CSSM Unlimited License v2.0 (CSSM-ULv2). See the LICENSE file for details.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: LicenseRef-CSSM-Unlimited-2.0
  • 更新时间: 2025-09-30