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
Tc Lib Color

Tc Lib Color Laravel Package

tecnickcom/tc-lib-color

PHP color toolkit for parsing, converting, and normalizing GRAY, RGB/RGBA, HSL, CMYK, CIE Lab, and spot colors, with named web color lookup. Provides CSS-ready output and PDF-oriented helpers, keeping browser previews and final rendered PDFs visually consistent. Part of the TCPDF ecosystem.

View on GitHub
Deep Wiki
Context7

tc-lib-color is a PHP color toolkit for parsing, converting, and normalizing color values across the models used in web and PDF rendering. It centralizes color logic so applications avoid ad-hoc conversion code and rounding drift, keeping visual output consistent between browser previews and final PDFs. Requires PHP 8.2+ and installs via Composer.

  • Multiple color models — grayscale, RGB/RGBA and hex, HSL/HSLA, CMYK, CIE Lab, and spot (Separation) colors
  • Cross-model conversion helpers available on every color model
  • CSS-ready output and PDF-oriented conversion helpers
  • Named web color lookup and normalization
  • Separation support with DeviceCMYK and Lab alternate color spaces
Frequently asked questions about Tc Lib Color
How do I install tc-lib-color in a Laravel application?
Install the package with Composer using composer require tecnickcom/tc-lib-color. It requires PHP 8.2 or later. Laravel does not auto-discover a service provider for this library, so you can resolve its classes directly or bind a wrapper in your own service provider.
Is tc-lib-color compatible with Laravel 10 and Laravel 11?
tc-lib-color is Composer-ready and PSR-4 autoloaded, and its PHP 8.2+ requirement aligns with Laravel 10+ LTS. Laravel 11 also runs on PHP 8.2+, so the library should install and run there. Confirm compatibility in CI against the exact Laravel and PHP versions you deploy.
What color formats does tc-lib-color support?
It supports GRAY, RGB/RGBA, HEX, HSL/HSLA, CMYK, CIE Lab, and spot/Separation colors. It also includes named web color lookup and CSS/PDF-oriented helpers. That coverage is broader than most simple RGB/HEX utilities.
Can tc-lib-color generate CSS colors and PDF colors from the same value?
Yes. The library provides CSS-ready output and PDF-oriented conversion helpers so a color can be normalized once and rendered for both browser and PDF contexts. This helps avoid rounding drift and ad-hoc conversion code across controllers, views, and PDF jobs. Spot colors and Lab support are the main differentiators for print-heavy workflows.
Does tc-lib-color work for CMYK to Lab or RGB to CMYK conversion?
Yes, cross-model conversion helpers are available on the color models, including RGB, CMYK, HSL, and Lab. Edge cases such as out-of-gamut Lab values and unusual CMYK inputs still need explicit handling in your application. The package is a color conversion layer, not a full ICC profiling or color-management system.
What are alternatives to tc-lib-color for Laravel color handling?
If you only need HEX/RGB conversion for UI theming, a smaller utility library or a few custom helpers may be simpler. tc-lib-color is strongest when you need CMYK, Lab, spot colors, and consistent web-to-PDF output. Compare alternatives on PHP 8.2+ support, license terms, conversion coverage, and maintenance activity.
How should I test color accuracy with tc-lib-color in Laravel?
Unit-test known conversion pairs such as HEX to RGB, RGB to CMYK, and CMYK to Lab with expected values and acceptable tolerances. For PDF output, add visual regression checks or snapshot comparisons of rendered documents. Include explicit tests for invalid hex strings, missing alpha channels, and out-of-gamut Lab inputs.
Is tc-lib-color maintained and safe to use in production?
The 3.0.12 patch release indicates active patch maintenance on the 3.0.x line, which weakens the earlier abandonware concern. However, release notes are thin, and the package has a low star count with limited real-world validation. Pin the version, review the source diff before upgrading, and gate updates with regression tests. The GNU LGPL v3 license is generally compatible with Laravel's MIT license, but static linking into a closed-source SaaS warrants legal review.
What changed in tc-lib-color 3.0.12 and is the upgrade breaking?
3.0.12 is a patch-level release on the 3.0.x line with no signalled breaking API changes. The public class surface is expected to remain unchanged, so a routine composer update within ^3.0 is reasonable. The release provides only a diff link and no changelog, so inspect the commit diff to determine whether it is a bug fix, PHP compatibility fix, or dependency bump.
Is tc-lib-color fast enough for bulk PDF generation in Laravel?
Color conversions such as RGB to CMYK and Lab handling add CPU and memory overhead, which can matter in high-throughput PDF jobs or serverless environments. The 3.0.12 release does not change that performance profile. Benchmark your batch sizes, cache repeated color conversions where possible, and avoid converting the same values repeatedly in hot paths.
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.
htinlynn/genius-helper
maco-studios/hephaestus
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator