Skip to content

Commit

Permalink
customize colors, font
Browse files Browse the repository at this point in the history
  • Loading branch information
MartkCz committed Jun 25, 2020
1 parent 0098b91 commit a6eb48e
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,19 @@ class CustomFormatter implements IFormatter {
}
```

Customize colors, fonts:

```php
$template = new Contributte\Invoice\Templates\DefaultTemplate();

$template->setEven(new Contributte\Invoice\Renderers\Color(0, 0, 0));
$template->setFont(new Contributte\Invoice\Renderers\Color(0, 0, 0));
$template->setEven(new Contributte\Invoice\Renderers\Color(0, 0, 0));
$template->setOdd(new Contributte\Invoice\Renderers\Color(0, 0, 0));

$invoice = new Contributte\Invoice\Invoice($company, $template);
```

## Translation

First, create class that implements ITranslator
Expand Down
20 changes: 20 additions & 0 deletions src/Templates/DefaultTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,26 @@ public function __construct(?ITranslator $translator = null, ?IFormatter $format
$this->formatter = $formatter ?: new Formatter();
}

public function setPrimary(Color $primary): void
{
$this->primary = $primary;
}

public function setFont(Color $font): void
{
$this->font = $font;
}

public function setEven(Color $even): void
{
$this->even = $even;
}

public function setOdd(Color $odd): void
{
$this->odd = $odd;
}

public function setItemsPerPage(int $itemsPerPage): self
{
$this->itemsPerPage = $itemsPerPage;
Expand Down

0 comments on commit a6eb48e

Please sign in to comment.