added project detail report (#2651)
- avatars via css only - random colors for entities - improves print view - added colors for teams - added color to tag
This commit is contained in:
@@ -31,6 +31,7 @@ class Extensions extends AbstractExtension
|
||||
new TwigFilter('multiline_indent', [$this, 'multilineIndent']),
|
||||
new TwigFilter('color', [$this, 'color']),
|
||||
new TwigFilter('font_contrast', [$this, 'calculateFontContrastColor']),
|
||||
new TwigFilter('default_color', [$this, 'defaultColor']),
|
||||
new TwigFilter('nl2str', [$this, 'replaceNewline'], ['pre_escape' => 'html', 'is_safe' => ['html']]),
|
||||
];
|
||||
}
|
||||
@@ -43,6 +44,7 @@ class Extensions extends AbstractExtension
|
||||
return [
|
||||
new TwigFunction('class_name', [$this, 'getClassName']),
|
||||
new TwigFunction('iso_day_by_name', [$this, 'getIsoDayByName']),
|
||||
new TwigFunction('random_color', [$this, 'randomColor']),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -71,11 +73,21 @@ class Extensions extends AbstractExtension
|
||||
return (new Color())->getColor($entity, $defaultColor);
|
||||
}
|
||||
|
||||
public function randomColor(?string $input = null): string
|
||||
{
|
||||
return (new Color())->getRandom($input);
|
||||
}
|
||||
|
||||
public function calculateFontContrastColor(string $color): string
|
||||
{
|
||||
return (new Color())->getFontContrastColor($color);
|
||||
}
|
||||
|
||||
public function defaultColor(?string $color = null): string
|
||||
{
|
||||
return $color ?? Constants::DEFAULT_COLOR;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param object $object
|
||||
* @return null|string
|
||||
|
||||
Reference in New Issue
Block a user