Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Couleur Laravel Package

bagistoplus/couleur

Couleur is a lightweight color utility for Laravel and PHP, offering helpers to define, convert, and format colors for use in views, CSS, and dynamic theming. A small, dependency-free addition for projects that need consistent color handling.

View on GitHub
Deep Wiki
Context7

A modern PHP 8.2+ color library, compatible with CSS Color Module Level 4

Frequently asked questions about Couleur
What is bagistoplus/couleur and what does it do?
Couleur is a lightweight, dependency-free PHP 8.2+ color utility that lets you define, convert, and format colors in Laravel and plain PHP. It claims compatibility with the CSS Color Module Level 4 syntax, which is its main differentiator over hand-rolled hex2rgb or lighten helpers. Typical uses are server-side surfaces that never touch a stylesheet, such as transactional email, PDF invoices, OG images, chart series, and server-rendered theme variables.
How do I install Couleur in a Laravel application?
Installation is just composer require bagistoplus/couleur, with no service provider, facade, config file, or migration to publish. The package is a leaf dependency, so it adds zero boot cost and no container coupling. Because the package has no stars, dependents, or documented semver policy, read the source and tests before committing to it.
Does Couleur support Laravel on PHP 8.1?
No. Couleur requires PHP 8.2 or newer, and that floor is a hard stop rather than a nuisance. If any app, queue worker, or CI image in your fleet still runs PHP 8.1, you cannot install it without upgrading first. Laravel version itself is not a constraint, since the package has no framework-version coupling.
Does Couleur really parse CSS Color Module Level 4 syntax?
The README claims CSS Color 4 support, but that claim is unverified against the spec, so treat it as a question to answer in the source. Check that the parser accepts none channels, percentage alpha like rgb(0 0 0 / 50%), modern space-separated syntax, and angle units such as deg, rad, and turn, and that it fails cleanly on malformed input. Regex-based parsers typically break on these forms, which surfaces as confusing rejections in admin forms.
Does Couleur ship a service provider, facade, or config file for Laravel?
No. Couleur is intentionally a leaf dependency with no service provider, no facade, no publishable config, and no migrations. The Laravel helpers mentioned in the description are likely documentation shorthand rather than real Blade directives, so plan to pass prepared color strings into your views. If you want framework ergonomics, wrap it in an application-owned adapter in a support or theming layer.
Is Couleur safe to use in production color conversions?
The technical risks are about correctness, not performance. Out-of-sRGB OKLCH or Lab values need proper gamut mapping with chroma reduction, and naive 0-255 clipping will produce brand colors that visibly disagree with the browser. Also verify the assumed white point (D50 versus D65) for Lab and LCH conversions, since a mismatch silently shifts every color relative to design tooling without throwing an error.
Which white point does Couleur assume for Lab and LCH conversions?
This is not answered in the README and must be confirmed by reading the conversion code yourself. A D50 versus D65 mismatch is a silent correctness bug: nothing errors, but every converted value shifts subtly against the CSS spec and your design tools. Check whether chromatic adaptation is exposed or hard-coded before relying on the output.
Can I use Couleur for emails, PDF invoices, and OG images?
Yes, and those surfaces are exactly where a PHP color engine is not optional, since email and PDF clients cannot consume CSS variables or Tailwind tokens. Couleur fits console commands, queued jobs, mail builders, and theme-compilation listeners rather than request-path rendering. It complements Tailwind and CSS variables rather than replacing them: PHP compiles the tokens and the browser consumes them.
How should I test Couleur before adopting it?
Read the package source end to end, which is feasible in under an hour given its size, and confirm the real FQCNs and method names instead of trusting documentation examples. Read the test suite too: if it does not exercise CSS Color 4 sample values, treat the library as untested code your team now owns. Add your own round-trip tests for achromatic colors and alpha-bearing colors, since grays can carry an arbitrary hue and drift on serialize to parse.
Is Couleur actively maintained, and what is the supply chain risk?
The package has one maintainer, zero stars, zero dependents, and no documented semver policy, so the realistic failure mode is abandonment rather than malice. There are no dependents to signal-test releases, so every upgrade should be treated as a reviewed change with your own tests around it. Keep it behind an adapter so a future swap or fork only touches one layer of your codebase.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource