Downloads
Stars
Version
Laravel Color Library Package
This is a simple package to manage and seed various color libraries I find my self using all time. You can use the defaults or simple add your own. Laratone provides a few routes to allow simple access via url.
Install via composer
composer require daikazu/laratone
php artisan vendor:publish --tag=laratone-config
You can change the table prefix name in the config to what ever you like.
<?php
return [
'table_prefix' => 'laratone_', //default
];
php artisan migrate
Use the Laratone artisan command to seed Color Books to your database.
The following Color Books have been made available for you;
PantonePlusSolidCoated
PantonePlusSolidCoated336NewColors
PantoneMetallicCoated
PantonePlusMetallicCoated
GuangShunThreadColors
HCTwillColors
php artisan laratone:seed
php artisan laratone:seed PantonePlusSolidCoatedSeeder
php artisan laratone:seed --file ./mycolorbookfile.json
Example Color Book format
{
"name": "Pantone Plus Solid Coated",
"data": [
{
"name": "Yellow C",
"lab": "88.19,-6.97,111.73",
"hex": "FEDD00",
"rgb": "254,221,0",
"cmyk": "0,1,100,0"
},
{
"name": "Yellow 012 C",
"lab": "86.69,-3.2,109.49",
"hex": "FFD700",
"rgb": "255,215,0",
"cmyk": "0,2,98,0"
}...
http://example.test/api/laratone/colorbooks
URL Parameter | Required | Description | Default |
---|---|---|---|
sort | false | Sort Color Book By Name asc or desc |
asc |
[
{
"name": "Pantone Plus Solid Coated 336 new Colors",
"slug": "pantone-plus-solid-coated-336-new-colors"
},
{
"name": "Pantone Plus Solid Coated",
"slug": "pantone-plus-solid-coated"
}...
]
Return colors from ColorBook based on ColorBook slug ie.pantone-plus-solid-coated
http://example.test/api/laratone/colorbook/pantone-plus-solid-coated
URL Parameter | Required | Description | Default | |
---|---|---|---|---|
sort | false | Sort Colors By Name asc or desc |
asc | |
limit | false | Limit number of colors returned | - | |
random | false | Set to true to randomize colors (overrides sort ) |
false |
{
"name": "Pantone Plus Solid Coated",
"slug": "pantone-plus-solid-coated",
"colors": [
{
"name": "100 C",
"lab": null,
"hex": "F6EB61",
"rgb": null,
"cmyk": null
},
{
"name": "101 C",
"lab": null,
"hex": "F7EA48",
"rgb": null,
"cmyk": null
}...
}
If you discover any security related issues, please email instead of using the issue tracker.
This project follows the all-contributors specification. Contributions of any kind welcome!
Copyright © Mike Wall
Laratone is open-sourced software licensed under the MIT license.