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

Iris Laravel Package

ozdemirburak/iris

PHP color library for manipulation and conversion between Hex, Hexa, RGB, RGBA, HSL, HSLA, HSV, CMYK, and OKLCH. Requires PHP 8.1+ and supports named colors, alpha channels, and conversion methods.

View on GitHub
Deep Wiki
Context7

Iris is a lightweight PHP library for color manipulation and conversion, supporting Hex, Hexa, RGB, RGBA, HSL, HSLA, HSV, CMYK, and OKLCH. It requires PHP 8.1+ and lets you parse named or formatted colors, inspect channels, and convert between supported models through a clean object-oriented API.

  • Convert seamlessly between Hex, RGB, HSL, HSV, CMYK, and OKLCH
  • Read individual channels such as red, hue, saturation, and alpha
  • Access normalized values for consistent calculations
  • Handle alpha transparency with Hexa, RGBA, and HSLA
  • Emit canonical string representations with simple echo
Frequently asked questions about Iris
How do I install ozdemirburak/iris in a Laravel application?
Install it with Composer by running composer require ozdemirburak/iris. It is a framework-agnostic PHP 8.1+ library with no service provider or config to publish, so installation is a single dependency plus PSR-4 autoloading. Verify that your application, CI, and production environments all run PHP 8.1 or newer.
Does ozdemirburak/iris support Laravel 10, 11, and 12?
Yes, Iris aligns with Laravel 10, 11, and 12 because those Laravel versions require PHP 8.1 or newer, matching the library's PHP 8.1+ constraint. It has no Laravel-specific version coupling. Pin a caret constraint and let dependency automation raise upgrade pull requests.
Is there a Laravel service provider or facade for Iris?
No. Iris has no Laravel service provider, facade, config file, or Blade directives because it is a framework-agnostic domain utility rather than infrastructure. You own all wiring, so register your own adapter or service in the container if you want a convenient injection point. Keep Factory::init() calls at the parse boundary instead of spreading them through the codebase.
What color formats does ozdemirburak/iris support?
Iris supports Hex, Hexa, RGB, RGBA, HSL, HSLA, HSV, CMYK, and OKLCH color models. Each model has its own value object and conversion methods such as toHex, toRgb, toHsl, and toOklch. Alpha is represented as a float on the alpha-aware types such as Hexa, RGBA, and HSLA.
How do I convert a Hex color to RGB, HSL, or OKLCH with Iris?
Create a color object and call the target conversion method, for example (new Hex('#ff00ff'))->toRgb() or ->toOklch(). The library also provides Factory::init() to resolve a color string to the correct type at runtime. Each conversion returns a typed color object rather than a loose array or string.
How do I lighten, saturate, mix, or generate gradients with Iris?
Iris exposes fluent manipulation methods such as lighten, saturate, spin, mix, tint, shade, fade variants, gradient, isLight, isDark, and background. These methods return color objects so you can chain operations. For design-system work, confirm that the built-in gradient interpolation meets your needs before relying on it for complex easing.
How do I safely parse and validate user-supplied color input with Iris?
Iris is not a Laravel validation rule and has no framework validation integration, so you must validate user-supplied color strings yourself. Wrap construction and Factory::init() in try/catch and translate failures into a 4xx response at the boundary. Do this inside a thin internal ColorService or value-object layer so exception behavior is normalized and not spread across controllers.
Does Iris support OKLCH alpha values and CSS relative color syntax?
Iris supports OKLCH as a conversion source and target, but it silently ignores alpha for OKLCH, so do not use it where OKLCH transparency matters. CSS relative color syntax using the from keyword is also unsupported. If either feature is on your roadmap, you need a wrapper or a different tool for that part.
Is ozdemirburak/iris accurate enough for brand color tokens and round-trip conversions?
Conversions are generally solid, and recent releases have fixed CMYK rounding, alpha precision, and RGBA-to-Hexa compositing issues, but you should not treat precision as guaranteed without tests. Add fixture tests against CSS Color 4 and W3C reference values, especially for OKLCH and CMYK, and define an acceptable tolerance for round trips such as Hex to OKLCH to Hex. Avoid depending on undocumented details such as exact string formatting or Factory guessing order.
Is ozdemirburak/iris safe and actively maintained for production Laravel use?
It is MIT-licensed and usable in production, but it is a single-maintainer package with roughly 124 stars and no dependents, so ecosystem validation is thin and your team owns upgrade risk. Pin a version such as ^4.1, wrap it behind an internal adapter, run composer audit in CI, and review changelogs quarterly. Community support is GitHub issues only, with no SLA or observed security advisory process.
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.
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect
youbar/easy-crud
c-point-labs/laravel-hostyourai
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo