mistralys/application-utils-core
Core utility library for PHP applications from Mistralys, bundling reusable helper classes and foundational components shared across its packages. A lightweight base for reducing boilerplate and standardizing common application tasks.
RGBAColor::setForceDark() / setForceLight() let us override the library's automatic luma-based contrast choice. This is the escape hatch we need for brand colors that sit near the mid-luma threshold where automated contrast picking is unreliable — the exact cases that fail AA contrast audits and generate accessibility tickets.RGBAColor instance and the companion methods let you remove/reset them, we can apply them at the point of rendering (badge/chip/status component, generated email, PDF template) rather than baking exceptions into a global theme config. That supports a per-surface decision: the same brand color can render differently in an email client than in the admin UI.Adopt when several of these are true:
application-utils-core) rather than a narrow color library; the contrast class is one of many concerns bundled in it.Look elsewhere or defer when:
isLight() check — a handful of lines beats a broad dependency.--on-primary). Runtime luma detection is then redundant, and a single source of truth in the design system is preferable.Watch item: the override API is new in this patch. Validate behavior in a spike against our actual brand palette and against edge cases (very saturated blues/reds, 50% gray) before removing any existing hand-tuned mappings.
To executives: This is a small, zero-risk upgrade to a utility library we use for color handling. It closes a known gap in our accessibility story: when the software automatically picks black or white text on a colored background, it can now be explicitly overridden for brand colors where the automatic choice is wrong. That converts contrast from a recurring QA-and-redesign loop into a one-line fix, which directly reduces accessibility remediation cost and supports the compliance commitments on the roadmap. The change is additive, has no breaking changes, and requires no migration.
To engineering: Patch release 2.5.1 on application-utils-core adds setForceDark() / setForceLight() to RGBAColor, plus companions to remove and reset luma overrides. This gives us an opt-out from automatic luma detection without forking or subclassing. Proposal: spike an onColor() helper on our badge/chip component that uses the override where design has flagged failures, keep the existing mappings until the spike clears our palette and edge cases, then retire them. No config or migration changes; the risk is a new-API surface (validate it) and the existing dependency footprint (unchanged).
How can I help you explore Laravel packages today?