Download the PHP package daikazu/laratone without Composer

On this page you can find all versions of the php package daikazu/laratone. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laratone

Laratone

Latest Version on Packagist GitHub Tests Action Status Supported PHP Version Supported Laravel Version Total Downloads

Laratone is a comprehensive Laravel package for managing color libraries and swatches in your applications. It provides an easy-to-use API for storing, retrieving, and managing color data, with built-in support for various color formats (HEX, RGB, CMYK, LAB, OKLCH) and popular color libraries.

Features

Requirements

Note: For Laravel 11 support, use version 4.x of this package.

Installation

You can install the package via composer:

Publish Configuration and Migrations

Publish the configuration file:

Publish and run the migrations:

Configuration

The published config file (config/laratone.php) contains the following options:

White Point Options

When RGB, CMYK, LAB, or OKLCH values are not provided, they are automatically calculated from the hex value. LAB calculations require a reference white point (illuminant). OKLCH is a perceptually uniform color space and does not require white point configuration.

Value Description Use Case
D50 Warm white (~5000K) Print/graphic arts
D55 Mid-morning daylight (~5500K) Photography
D65 Standard daylight (~6500K) Default, web/screen
D75 North sky daylight (~7500K) Scientific applications

Checking Your Setup

Laratone adds a section to Laravel's about command showing the installed version and key settings:

Usage

Seeding Color Books

Laratone comes with several pre-built color libraries:

Seed All Color Books

Seed Specific Color Books

Import Custom Color Books

Example Color Book format:

Note: Only name and hex are required. RGB, CMYK, LAB, and OKLCH values are optional and will be auto-calculated from hex if not provided. If you have official color values (e.g., Solid Coated LAB values), include them to use those instead of calculated values.

REST API

All endpoints live under /api/laratone by default. Change the prefix, or turn the routes off entirely if you only use the facade:

Route names (laratone.colorbooks, laratone.colorbook, laratone.colorbook.search, laratone.colorbook.find-closest, laratone.find-closest) stay the same whatever the prefix, so route() calls keep working.

Color Books

List all available color books:

Parameter Required Description Default
sort No Sort by name (asc/desc) -

Colors

Get colors from a specific color book:

Parameter Required Description Default
sort No Sort by name (asc/desc) -
limit No Limit number of results -
random No Randomize results (1/true) false

Note: When using random=true, results are not cached to ensure different results on each request.

Search Colors

Search a color book's colors by name or code. Matching is case-insensitive and finds the text anywhere in the name:

Parameter Required Description Default
q Yes Text to search for in color names (max 100 chars) -
limit No Maximum number of results (up to max_match_limit) 25

Example Request:

Example Response:

Results are ordered by name. This example is trimmed to one match; the full response also includes 2185 C and 5185 C.

Find Closest Colors

Find the closest matching colors in a color book to a target color:

Parameter Required Description Default
hex Yes Target color (6-char hex, with or without #) -
limit No Number of closest colors to return 1
algorithm No Distance algorithm: lab, ciede2000 or oklch default_match_algorithm (lab)

Example Request:

Example Response:

Find Closest Colors Across All Books

Find the closest matches to a target color in every color book at once, for example to see which ink or thread library has the nearest match:

Takes the same hex, limit and algorithm parameters as the single-book endpoint. Each match includes the color book it came from. Here, ?hex=FF5500&algorithm=ciede2000 finds the same Solid Coated color, scored with CIEDE2000:

Distance Algorithms

Algorithm Description Best For
lab CIE76 Delta E: straight-line distance in LAB space Fast general matching (the default)
ciede2000 CIEDE2000 Delta E: corrects CIE76's errors with saturated colors and blues Print, ink and textile matching, the industry standard
oklch Distance in the OKLab color space Modern screen colors, consistent perception

Distances aren't comparable between algorithms. For CIE76 and CIEDE2000, a distance under about 1 is barely visible and under 2–3 is a close match. OKLCH distances are on a much smaller scale.

Rate Limiting & Custom Middleware

Laratone routes are rate limited to 60 requests per minute by default. Configure this with the rate_limit option (throttle middleware format, "maxAttempts,decayMinutes"):

Routes also pass through a laratone middleware alias that does nothing by default. You can replace it with your own middleware to add authentication, logging, or a custom rate limiter (set rate_limit to null to avoid double throttling).

Define the alias in a service provider:

You can create a custom middleware class that combines multiple behaviors:

Programmatic Usage

Laratone provides a simple API for managing colors programmatically:

Working with Color Models

Color values are automatically cast to associative arrays when accessed. If a value wasn't stored in the database, it will be automatically calculated from the hex value:

Auto-Calculation Behavior

Caching

Laratone automatically caches color book and color data to improve performance. The cache works with any Laravel cache driver, including file, database, Redis, and Memcached.

Cache is automatically cleared when:

To manually clear the cache:

Or programmatically:

AI Assistance (Laravel Boost)

Laratone ships Laravel Boost resources, so AI coding agents know how to use the package:

If your app uses Boost, they're picked up automatically when you run:

Upgrading

See UPGRADE.md for upgrade instructions between major versions.

Testing

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of laratone with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
illuminate/contracts Version ^12.0|^13.0
illuminate/support Version ^12.0|^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package daikazu/laratone contains the following files

Loading the files please wait ...