PHPackages                             donatj/alike-color-finder - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. donatj/alike-color-finder

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

donatj/alike-color-finder
=========================

v0.8.0(2y ago)378.2k—4.2%MITPHPPHP &gt;=5.4CI passing

Since Jan 6Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/donatj/AlikeColorFinder)[ Packagist](https://packagist.org/packages/donatj/alike-color-finder)[ Fund](https://www.paypal.me/donatj/15)[ GitHub Sponsors](https://github.com/donatj)[ RSS](/packages/donatj-alike-color-finder/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (14)Used By (0)

Alike Color Finder
==================

[](#alike-color-finder)

[![CI](https://github.com/donatj/AlikeColorFinder/actions/workflows/ci.yml/badge.svg)](https://github.com/donatj/AlikeColorFinder/actions/workflows/ci.yml)[![Latest Stable Version](https://camo.githubusercontent.com/ac1d5c09bf3188da136b3417399bab6fec643b2ec1577417f548a79434b8b77b/68747470733a2f2f706f7365722e707567782e6f72672f646f6e61746a2f616c696b652d636f6c6f722d66696e6465722f762f737461626c652e706e67)](https://packagist.org/packages/donatj/alike-color-finder)[![Total Downloads](https://camo.githubusercontent.com/71b7e90289b7f9735422cce4d1e3d8fff0fd16822e4e3e95d866991dfa66f254/68747470733a2f2f706f7365722e707567782e6f72672f646f6e61746a2f616c696b652d636f6c6f722d66696e6465722f646f776e6c6f6164732e706e67)](https://packagist.org/packages/donatj/alike-color-finder)[![Latest Unstable Version](https://camo.githubusercontent.com/bacfdd822de1088d5bcf93a0c02ddbfc641055101fa25f2679502a6ae92c31d5/68747470733a2f2f706f7365722e707567782e6f72672f646f6e61746a2f616c696b652d636f6c6f722d66696e6465722f762f756e737461626c652e706e67)](https://packagist.org/packages/donatj/alike-color-finder)[![License](https://camo.githubusercontent.com/966699e276d65c6295f6813a4cc9d994227e180fe79f9a7c51dd16b1b08f274d/68747470733a2f2f706f7365722e707567782e6f72672f646f6e61746a2f616c696b652d636f6c6f722d66696e6465722f6c6963656e73652e706e67)](https://packagist.org/packages/donatj/alike-color-finder)

Finds similar (e.g. alike) colors in CSS and CSS-like data, within a set likeness threshold. It compares `#hex`, `rgb()`, `rgba()`, `hsl()`, and `hsla()` colors.

Includes the [CIEDE2000](http://en.wikipedia.org/wiki/Color_difference#CIEDE2000)+Alpha (default), [CIE94](http://en.wikipedia.org/wiki/Color_difference#CIE94)+Alpha, as well as "*actual*" mathematical absolute color diff strategies, switchable with a flag.

A web based interface to this exists [here](https://donatstudios.com/CSS-Alike-Color-Finder).

Why
---

[](#why)

***Very similar*** but *not* identical colors seem to pop up really often in CSS files of any reasonable age, and I became **sick** of them. This started as a little script to help me find them in a stylesheet, and grew into this full-fledged tool.

This is fully usable within CI solutions to pass/fail a project.

Requirements
------------

[](#requirements)

- PHP 5.4.0+ with CLI and SPL, PHP 7.4+ strongly recommended

Installation
------------

[](#installation)

Using composer, `alike` can be installed globally via:

```
$ composer global require 'donatj/alike-color-finder'
```

Or if you are using composer for the project you wish to test, you can simply add it as a [vendor binary](https://getcomposer.org/doc/articles/vendor-binaries.md):

```
composer require --dev 'donatj/alike-color-finder'
```

Usage
-----

[](#usage)

Pass CSS-like files to scan as arguments.

```
$ alike main.css shared.scss
```

Or pipe CSS into stdin.

```
$ alike
