laradic / annotation-scanner by radic

Scan directories or files for annotations
53
1
2
Package Data
Maintainer Username: radic
Maintainer Contact: robin@laradic.nl (Robin Radic)
Package Create Date: 2016-08-17
Package Last Update: 2018-03-04
Home Page:
Language: PHP
License: MIT
Last Refreshed: 2024-05-03 15:18:38
Package Statistics
Total Downloads: 53
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 1
Total Watchers: 2
Total Forks: 0
Total Open Issues: 0

Laradic Icon Generator

Source License Framework

Icon Generator can create PNG images from several icon fonts like FontAwesome, Foundation Icons, etc. For example, useful for favicon generation.

The package follows the FIG standards PSR-1, PSR-2, and PSR-4 to ensure a high level of interoperability between shared PHP code.

Installation

composer require "laradic/annotation-scanner:~1.0"

Quick Overview

Full documenation @ la.radic.nl

Using the default generators

require __DIR__ . '/vendor/autoload.php';

use Laradic\IconGenerator\Factory;
use Laradic\IconGenerator\IconGenerator;

$icons = new Factory;
$icons->addDefaultFonts();
$generator = $icons->createGenerator('font-awesome');
$generator->setIcons('android', 'car', 'html5', 'github');

// 16x16px, 32x32px, etc
$generator->setSizes(16, 32, 64, 128);

// add some material colors
$generator->addColor('#ef5350'); // red 400
$generator->addColor('#42A5F5'); // blue 400
$generator->addColor('#424242'); // grey 800
$generator->addColor(251, 94, 11); // RGB Also supported

$generator->setOutDir(__DIR__ . '/../generated');

$generator->generate($prefix);

$generator->generate();

Using the default generators

require __DIR__ . '/vendor/autoload.php';

use Laradic\IconGenerator\Factory;
use Laradic\IconGenerator\IconGenerator;

$icons = new Factory;
$icons->addDefaultFonts();
$generate = function (IconGenerator $generator, $prefix = '') {

    // 16x16px, 32x32px, etc
    $generator->setSizes(16, 32, 64, 128);

    // add some material colors
    $generator->addColor('#ef5350'); // red 400
    $generator->addColor('#42A5F5'); // blue 400
    $generator->addColor('#424242'); // grey 800

    $generator->setOutDir(__DIR__ . '/../generated');

    $generator->generate($prefix);
};


$fa = $icons->createGenerator('font-awesome');
$fa->setIcons('android', 'car', 'html5', 'github');
$generate($fa, 'fa-');


$found = $icons->createGenerator('foundation-general');
$found->setIcons([ 'checkmark', 'remove', 'mail', 'calendar' ]);
$generate($found, 'found-');