PHP code example of laradic / icon-generator

1. Go to this page and download the library: Download laradic/icon-generator library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

laradic / icon-generator example snippets


/** @var \Laradic\IconGenerator\IconGenerator $generator */
$generator = (new \Laradic\IconGenerator\Factory)
                ->addDefaultFonts()
                ->createGenerator('font-awesome');

$generator->setIcons('android', 'car')
            ->setSizes(16, 32, 64, 128)
            ->addColor('#42A5F5') // blue 400
            ->addColor('#424242') // grey 800
            ->addColor(251, 94, 11) // RGB Also supported
            ->setOutDir(__DIR__ . '/generated-icons')
            ->generate();

(new Factory())
    ->addDefaultFonts()
    ->generate($font, array $icons, array $sizes, array $colors, $outDir = null);

$generator = app('laradic.icon-generator')
                ->addDefaultFonts()
                ->createGenerator('font-awesome');
// other code remains the same

$generator = IconGenerator::addDefaultFonts()->createGenerator('font-awesome');