Weave Code
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

Iris is a PHP 8.1+ color library for parsing, manipulating, and converting colors across Hex/Hexa, RGB/RGBA, HSL/HSLA, HSV, CMYK, and OKLCH. Provides format classes with channel accessors and easy toX() conversions.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Dynamic Theming & Branding Systems:

    • Enable real-time color manipulation for adaptive UI themes (e.g., dark/light mode toggles, accessibility compliance).
    • Support gradient generation for dynamic backgrounds, progress bars, or data visualizations (e.g., charts, maps).
    • Example: A dashboard where users can customize color schemes via sliders, with Iris handling conversions between HSL/HSV/RGB/CMYK for print/export consistency.
  • Design System Integration:

    • Build vs. Buy: Replace manual CSS/JS color utilities (e.g., color-mix(), hsl()) with a server-side PHP library for consistency across frontend/backend (e.g., generating color palettes for API responses or CMS content).
    • Example: A headless CMS where color values are stored in HSL but rendered as OKLCH for perceptual uniformity in UI components.
  • Accessibility & Compliance:

    • Automate color contrast validation (e.g., isLight()/isDark()) to enforce WCAG standards in generated content (e.g., error messages, data tables).
    • Example: A form builder where Iris validates text/background color pairs dynamically.
  • Print & Multi-Channel Output:

    • CMYK support for print-ready assets (e.g., generating PDFs or invoices with color-accurate branding).
    • Example: An e-commerce platform converting product images from RGB (web) to CMYK (print catalogs).
  • Roadmap Priorities:

    • Phase 1: Integrate Iris into a color picker utility for non-technical users (e.g., marketing teams).
    • Phase 2: Extend to automated palette generation (e.g., extracting dominant colors from images via Iris + a PHP image library like Intervention).
    • Phase 3: Add color space validation (e.g., blocking invalid HSL values like saturation > 100%).

When to Consider This Package

Adopt Iris When:

  • Your stack is PHP/Laravel and you need server-side color manipulation (e.g., generating dynamic assets, processing user-uploaded color schemes).
  • You require multi-format support (Hex, HSL, OKLCH, CMYK) for cross-platform consistency (e.g., web + print + API responses).
  • Performance matters: Iris is lightweight (~10KB) and avoids client-side JS dependencies for color ops.
  • You need programmatic color adjustments (e.g., darkening a background for UI states, creating gradients for visualizations).
  • Your team lacks design system expertise but needs to enforce color standards (e.g., via Iris’s isLight()/isDark() methods).

Look Elsewhere If:

  • You’re frontend-only: Use CSS color-mix() or JS libraries like chromajs for client-side interactivity.
  • You need real-time UI previews: Iris is server-side; pair with a JS library for live color pickers.
  • OKLCH support is critical: While Iris includes OKLCH, browser support for CSS OKLCH is still evolving (target 2024+).
  • You’re working with legacy PHP (<8.1): Iris dropped PHP 7 support in 2022.
  • Image-based color extraction is needed: Combine Iris with a library like Imagick for advanced use cases.

How to Pitch It (Stakeholders)

For Executives:

"Iris is a low-code solution to eliminate manual color management across our digital products. By integrating this PHP library, we can:

  • Automate compliance: Ensure all UI elements meet WCAG contrast standards without designer intervention.
  • Unify branding: Generate consistent color palettes for web, print, and APIs—reducing errors in marketing assets.
  • Accelerate development: Replace ad-hoc CSS/JS color hacks with a single source of truth for color logic. For example, our dashboard’s dynamic theming feature could use Iris to convert user-selected HSL values to OKLCH for perceptual accuracy, while our print exports leverage CMYK support. The MIT license and active maintenance make it a zero-risk, high-reward investment."

For Engineers:

"Iris is a batteries-included PHP library for color manipulation that solves:

  • Format conversions: Hex ↔ HSL ↔ OKLCH ↔ CMYK in one line (e.g., $hex->toOklch()).
  • Programmatic adjustments: Darken/lighten, spin hues, or generate gradients without math libraries.
  • Accessibility checks: $color->isLight() to validate text/background pairs.
  • Performance: Zero dependencies beyond PHP 8.1; ~10KB footprint.

Use cases:

  • Backend APIs: Return OKLCH colors for UI components.
  • CMS/plugins: Store colors in HSL but render as Hex for legacy systems.
  • Data viz: Generate gradients for charts via $colorA->gradient($colorB, 10). Migration path: Start with a proof-of-concept (e.g., replace hardcoded CSS variables with Iris-generated values in a Laravel Blade template)."*

For Designers:

"Iris lets you enforce your color system without manual CSS tweaks. Key wins:

  • Dynamic theming: Adjust saturation/lightness programmatically (e.g., dark mode with $color->darken(20)).
  • Print-ready exports: Convert web colors to CMYK for invoices or catalogs.
  • Consistency: Avoid ‘off-brand’ colors by validating hues/saturation via Iris’s methods. Example: Instead of manually editing CSS for a ‘highlight’ state, use $primaryColor->saturate(15)->toHex() in your Laravel backend to generate it on demand."*
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.
cadot.eu/make
besmartand-pro/php-quality-config
sentix/ai-chatbot
codifyo/ts-generator-bundle
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky