Giter Club home page Giter Club logo

laravel-colors's Introduction

laravel-colors

Build Status Latest Stable Version License

Build and manage color schemes for Laravel applications.

Screenshot

About

laravel-colors allows you to view, create, and edit your project's color scheme in the browser. It reads the sass file where your color variables are declared and displays these colors in the browser. It also allows you to create and edit color schemes and save them to your database.
Notes:

  • This package is not able to push color schemes to your actual project. You still must manually set the colors in your css/sass files.
  • Reading your projects color scheme requires that you use sass and that you have a colors file where you declare your sass color variables ($purple: rgb(62, 62, 175); etc.)
  • Currently supports hex color values (#ffffff) and rgb color values (rgb(255, 255, 255))
  • Colors with transparency values are not yet supported so they may display incorrectly

Installation and Setup

Install through composer:

composer require zachleigh/laravel-colors

Once installed, register the service provider in your Laravel project. Because laravel-colors is for development use only, conditionally load the provider in your project's AppServiceProvider register method and import the namespace at the top of the file.

use Illuminate\Support\ServiceProvider;
use LaravelColors\LaravelColorsServiceProvider;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        //
        //

        if ($this->app->environment('local')) {
            $this->app->register(LaravelColorsServiceProvider::class);
        }
    }
}

Next, publish the config file.

php artisan vendor:publish --provider="LaravelColors\LaravelColorsServiceProvider" --force

This will move the config file to App/config/laravel-colors.php. This file has two values, 'route' and 'sass_file'. 'route' is the url where your project's color scheme can be seen in the browser. The default route is '/laravel-colors/colors'. 'sass_file' is the location of your sass colors file. This file will be read by laravel-colors. If you do not have a sass file or do not want laravel-colors to attempt to read a file, set 'sass_file' to 'none' and the default color scheme will be used.

The publish command will also put a migration in App/database/migrations/. This migration sets up the database table used to store your color schemes. Run the migration:

php artisan migrate

Finished. Now simply visit the route defined in the config file in your browser and see your project's color scheme in all its beautiful glory.

Development

Pull requests are welcome.

laravel-colors's People

Contributors

zachleigh avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.