PHPackages                             kaishiyoku/laravel-color-validation - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. kaishiyoku/laravel-color-validation

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

kaishiyoku/laravel-color-validation
===================================

Laravel color validation rules

4.0.0(2mo ago)5206.7k↑25%5MITPHPPHP ^8.2CI passing

Since Dec 13Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/Kaishiyoku/laravel-color-validation)[ Packagist](https://packagist.org/packages/kaishiyoku/laravel-color-validation)[ Docs](https://github.com/Kaishiyoku/laravel-color-validation)[ RSS](/packages/kaishiyoku-laravel-color-validation/feed)WikiDiscussions master Synced 1mo ago

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

[![Tests](https://github.com/Kaishiyoku/laravel-color-validation/actions/workflows/tests.yml/badge.svg)](https://github.com/Kaishiyoku/laravel-color-validation/actions/workflows/tests.yml)[![Latest Stable Version](https://camo.githubusercontent.com/31c6726feee117ba5f3958c4872c5545a87826e2e005a729f669a613f9785a98/687474703a2f2f706f7365722e707567782e6f72672f6b6169736869796f6b752f6c61726176656c2d636f6c6f722d76616c69646174696f6e2f76)](https://packagist.org/packages/kaishiyoku/laravel-color-validation)[![Total Downloads](https://camo.githubusercontent.com/e8936b3ce5ffd4fdf64274e0e6857bcf8331f86bf698006f3209a5e9a19e565d/687474703a2f2f706f7365722e707567782e6f72672f6b6169736869796f6b752f6c61726176656c2d636f6c6f722d76616c69646174696f6e2f646f776e6c6f616473)](https://packagist.org/packages/kaishiyoku/laravel-color-validation)[![License](https://camo.githubusercontent.com/33f99d257e88fbfc5f9237ffe318cf17bd61298464893ffd1e0951f64578903a/687474703a2f2f706f7365722e707567782e6f72672f6b6169736869796f6b752f6c61726176656c2d636f6c6f722d76616c69646174696f6e2f6c6963656e7365)](https://packagist.org/packages/kaishiyoku/laravel-color-validation)[![PHP Version Require](https://camo.githubusercontent.com/6a1e7cd37bdc0b27e7494e262a5c81d4c87aa841af90823d7f7ea5744c385188/687474703a2f2f706f7365722e707567782e6f72672f6b6169736869796f6b752f6c61726176656c2d636f6c6f722d76616c69646174696f6e2f726571756972652f706870)](https://packagist.org/packages/kaishiyoku/laravel-color-validation)

About
=====

[](#about)

**This package will let you validate that a certain value is a valid CSS color string using Laravel &gt;= 10.**

Minimum requirements
====================

[](#minimum-requirements)

- PHP 8.2
- Laravel 11

Installation
============

[](#installation)

Install via [composer](https://getcomposer.org/) - In the terminal:

```
composer require kaishiyoku/laravel-color-validation
```

If you're not using package auto-discovery add the following to the `providers` array in your `config/app.php`

```
Kaishiyoku\Validation\Color\ServiceProvider::class,
```

Usage
=====

[](#usage)

```
// Test any color type
Validator::make(['test' => '#454ACF'], ['test' => 'color']);

// Test for rgb
Validator::make(['test' => 'rgb(0, 200, 150)'], ['test' => 'color_rgb']);

// Test for rgba
Validator::make(['test' => 'rgba(0, 200, 150, 0.52)'], ['test' => 'color_rgba']);

// Test for hex
Validator::make(['test' => '#333'], ['test' => 'color_hex']);

// Test for color name
Validator::make(['test' => 'DeepSkyBlue'], ['test' => 'color_name']);
Validator::make(['test' => 'transparent'], ['test' => 'color_name']);
```

Using other locales
===================

[](#using-other-locales)

By default English, German and French locales can be used. If you're using a different locale you will have to add a `validation.php` file and a custom folder named after the locale code (e.g. `ja` for Japanese) to the `/resources/lang/vendor/color_validation/` folder.

Example folder structure:

```
.
    └── resources
        └── lang
            └── vendor
                └── color_validation
                    ├── de
                    ├── en
                    └── ja

```

Adjusting existing locales
==========================

[](#adjusting-existing-locales)

If you want to change any of the existing translations, you can publish the locale files with:

```
php artisan vendor:publish --provider="Kaishiyoku\Validation\Color\ServiceProvider"
```

License
=======

[](#license)

MIT ()

Author
======

[](#author)

Website: [andreas-wiedel.de](https://andreas-wiedel.de)

###  Health Score

61

—

FairBetter than 99% of packages

Maintenance86

Actively maintained with recent releases

Popularity40

Moderate usage in the ecosystem

Community16

Small or concentrated contributor base

Maturity82

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 86.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~146 days

Recently: every ~279 days

Total

19

Last Release

74d ago

Major Versions

1.6.1 → 2.0.02022-01-20

2.1.1 → 3.0.02024-02-29

3.2.0 → 4.0.02026-03-06

PHP version history (6 changes)1.0.0PHP &gt;=7.1.3

1.2.0PHP ^7.2

1.6.1PHP ^7.2|^8.0

2.0.0PHP ^7.4|^8.0

3.0.0PHP ^8.1

4.0.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/a7349944ba7795f1fbec27cf22625511bc8e7fdc6b55529ac87788485cca1797?d=identicon)[Kaishiyoku](/maintainers/Kaishiyoku)

---

Top Contributors

[![Kaishiyoku](https://avatars.githubusercontent.com/u/5131112?v=4)](https://github.com/Kaishiyoku "Kaishiyoku (97 commits)")[![tylercd100](https://avatars.githubusercontent.com/u/4522226?v=4)](https://github.com/tylercd100 "tylercd100 (11 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (2 commits)")[![jkudish](https://avatars.githubusercontent.com/u/260253?v=4)](https://github.com/jkudish "jkudish (1 commits)")[![sigit-noviandi](https://avatars.githubusercontent.com/u/4091404?v=4)](https://github.com/sigit-noviandi "sigit-noviandi (1 commits)")

---

Tags

laravelvalidatorcolorvalidation-rules

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/kaishiyoku-laravel-color-validation/health.svg)

```
[![Health](https://phpackages.com/badges/kaishiyoku-laravel-color-validation/health.svg)](https://phpackages.com/packages/kaishiyoku-laravel-color-validation)
```

###  Alternatives

[proengsoft/laravel-jsvalidation

Validate forms transparently with Javascript reusing your Laravel Validation Rules, Messages, and FormRequest

1.1k2.3M49](/packages/proengsoft-laravel-jsvalidation)[sunspikes/clamav-validator

Custom Laravel 5 anti-virus validator for file uploads.

3651.8M3](/packages/sunspikes-clamav-validator)[laravel-validation-rules/credit-card

Validate credit card number, expiration date, cvc

2412.2M5](/packages/laravel-validation-rules-credit-card)[intervention/validation

Additional validation rules for the Laravel framework

6826.7M8](/packages/intervention-validation)[axlon/laravel-postal-code-validation

Worldwide postal code validation for Laravel and Lumen

3853.3M1](/packages/axlon-laravel-postal-code-validation)[illuminatech/validation-composite

Allows uniting several validation rules into a single one for easy re-usage

184485.5k](/packages/illuminatech-validation-composite)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
