PHP code example of atelier / field

1. Go to this page and download the library: Download atelier/field 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/ */

    

atelier / field example snippets


use Atelier\Field\Field;

echo Field::waves(360, 240, layers: 5, seed: 1)->withColor('#cf4d9b')->toSvg();



declare(strict_types=1);

use Atelier\Field\Field;

Color('#cf4d9b');

file_put_contents(__DIR__.'/waves.svg', $field->toSvg());

$document->getRootElement()?->appendChild($field->element());

echo $field->toCss();

echo $field->withColor('#0067a0')
    ->withBackground('#f6f5f1')
    ->withOpacity(0.6)
    ->toSvg();

use Atelier\Field\Theme;

echo $field->withTheme(Theme::blueprint())->toSvg();