Add-Type -AssemblyName System.Drawing $iconRoot = Join-Path $PSScriptRoot '../public/icons' New-Item -ItemType Directory -Force -Path $iconRoot | Out-Null foreach ($iconSpec in @(@('icon-192.png',192), @('icon-512.png',512), @('maskable-512.png',512), @('apple-touch-icon.png',180))) { $iconSize = [int]$iconSpec[1] $bitmap = New-Object System.Drawing.Bitmap($iconSize,$iconSize) $graphics = [System.Drawing.Graphics]::FromImage($bitmap) $graphics.SmoothingMode = [System.Drawing.Drawing2D.SmoothingMode]::AntiAlias $graphics.ScaleTransform($iconSize / 192.0, $iconSize / 192.0) $graphics.Clear([System.Drawing.ColorTranslator]::FromHtml('#8391ed')) $cream = New-Object System.Drawing.SolidBrush([System.Drawing.ColorTranslator]::FromHtml('#f5f5ef')) $ringPen = New-Object System.Drawing.Pen($cream,8) $graphics.DrawEllipse($ringPen,48,54,96,96) foreach ($point in @(@(72,112),@(95,122),@(118,112),@(96,99))) { $graphics.FillEllipse($cream,($point[0]-8),($point[1]-8),16,16) } $leaf = New-Object System.Drawing.Drawing2D.GraphicsPath $leaf.AddBezier(96,50,94,27,119,26,120,27) $leaf.AddBezier(120,27,120,44,105,51,96,50) $green = New-Object System.Drawing.SolidBrush([System.Drawing.ColorTranslator]::FromHtml('#cad1ff')) $graphics.FillPath($green,$leaf) $bitmap.Save((Join-Path $iconRoot $iconSpec[0]),[System.Drawing.Imaging.ImageFormat]::Png) $graphics.Dispose(); $bitmap.Dispose(); $cream.Dispose(); $ringPen.Dispose(); $leaf.Dispose(); $green.Dispose() }