Download the PHP package atelier/pattern without Composer

On this page you can find all versions of the php package atelier/pattern. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package pattern

Repeatable SVG tiles for fills and strokes, in PHP.

PHP Version Version Tests PHPUnit PHPStan

Fill a surface with dots, stripes, grids, or geometric and seeded motifs. Each tile joins with itself so the pattern repeats across the surface.

Examples from the catalogue: staggered dots and seigaiha.

A pattern is an immutable value. It needs no document to exist and provides a <pattern> element plus the url(#id) that references it. Add the tile to an Atelier SVG document and use it as a fill or stroke. For drawings generated for one viewport, see atelier/field.

Documentation

Installation

Requires PHP 8.3+ and atelier/svg. Composer installs the package dependencies.

Quick start

The example has three steps:

  1. Create the tile with Pattern::dots().
  2. Register it in the document with PatternRegistry.
  3. Fill the rectangle using $dots->fill().

The registry places the tile in <defs>. Its identifier is derived from its geometry and style.

Style

Style methods return a new pattern, leaving the original unchanged. The following snippets reuse the imports and autoloader above.

The default paint is currentColor and the tile background is transparent. The colour inherits from the pattern definition's ancestors in <defs>; setting color on the SVG root themes it. A consuming shape's own color does not recolour that definition. For independent colours, create patterns with different withColor() values and register each one.

Catalogue


Dots

Stripes

Crosshatch

Grid

Triangles

Honeycomb

Scales

Herringbone

Chevron

Houndstooth

Isometric cubes

Asanoha

Seigaiha

Flower of life

Checker

Quatrefoil

Greek key

Truchet

Jittered dots

Rough hatch

Staggered bricks

Confetti

Voronoi

Mosaic

Error handling

Invalid geometry or styling throws Atelier\Pattern\Exception\InvalidArgumentException. All package exceptions implement Atelier\Pattern\Exception\ExceptionInterface. Each tile documents its accepted ranges; see Getting started for validation, identifiers, and seeded output guarantees.

Gallery

From a repository checkout with dependencies installed:

Writes examples/output/index.html with every tile rendered at 300 by 200.

Documentation

Read the complete guides and generated illustrations in docs/.

Contributing

Contributions are welcome. Visit the project on GitHub to report a bug, suggest a feature, or open a pull request.

Before submitting code, run:

Changes to public behaviour need tests and a documentation update. Keep line coverage at 100%. Coverage reporting requires PCOV or Xdebug.

Support

Bug reports, security disclosures, and contribution guidelines are collected at ateliersvg.com/support.

License

Atelier Pattern is released under the MIT License.


All versions of pattern with dependencies

PHP Build Version
Package Version
Requires php Version >=8.3
atelier/svg Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package atelier/pattern contains the following files

Loading the files please wait ...