chernegasergiy / color-converter
A simple PHP color converter CLI application.
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Type:project
pkg:composer/chernegasergiy/color-converter
README
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
- Ensure you have PHP installed.
- 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.
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.
After confirming your input, the script will display the final conversion result.
Contributing
Contributions are welcome and appreciated! Here's how you can contribute:
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - 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.