Skip to content

Commit 91f74c7

Browse files
committed
always add a background color to the apple touch icon
1 parent 97064e4 commit 91f74c7

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

bin/favicon-generator

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ final class CliContext
108108
writeln('Options:');
109109
writeln('--icon-background Set color under icon, defaults to transparent');
110110
writeln('--theme-color Color to used in manifest `theme_color` and default letter background color, defaults to #00AAAD');
111-
writeln('--tile-color Color to used in manifest `background_color` and used fill ms-tiles with, defaults to #00AAAD');
111+
writeln('--tile-color Color to used in manifest `background_color` and used fill apple touch and ms-tiles with, defaults to #00AAAD');
112112
writeln('--letter-color Color of the letter, used when using letter: input, defaults to #FFFFFF');
113113
writeln('--letter-background Color of the background, used when using letter: input, defaults to theme color');
114114
writeln('--root Location inside the root directory where the favicons are saved to, defaults to /');

src/ApplePackage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public function __construct(
1313

1414
public function package(Input $input, WebApplicationManifest $manifest, string $rootPrefix): \Generator
1515
{
16-
$generator = new AppleTouchGenerator($input, $this->size);
16+
$generator = new AppleTouchGenerator($input, $this->size, $manifest->backgroundColor);
1717
yield 'apple-touch-icon.png' => $generator->generate();
1818

1919
$generator = AppleSafariPinGenerator::cliDetectImageMagickVersion($input);

src/AppleTouchGenerator.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ final class AppleTouchGenerator implements GeneratorInterface
99
public function __construct(
1010
private readonly Input $input,
1111
private readonly int $size,
12+
private readonly string $backgroundColor,
1213
) {
1314
}
1415

@@ -25,7 +26,7 @@ public function generate(): string
2526
$composite->newImage($newWidth + 2 * $padding, $newHeight + 2 * $padding, new \ImagickPixel('none'));
2627

2728
$paddingDraw = new \ImagickDraw();
28-
$paddingDraw->setFillColor(new \ImagickPixel($this->input->backgroundColor));
29+
$paddingDraw->setFillColor(new \ImagickPixel($this->backgroundColor));
2930
$paddingDraw->roundRectangle(
3031
0,
3132
0,

0 commit comments

Comments
 (0)