20 lines
925 B
PowerShell
20 lines
925 B
PowerShell
Add-Type -AssemblyName System.Drawing
|
|
$bmp = New-Object System.Drawing.Bitmap(256, 256)
|
|
$g = [System.Drawing.Graphics]::FromImage($bmp)
|
|
$g.SmoothingMode = [System.Drawing.Drawing2D.SmoothingMode]::AntiAlias
|
|
$colors = @('#E5484D', '#F76B15', '#F5A623', '#30A46C', '#12A594', '#0091FF', '#5E5CE6', '#BF5AF2')
|
|
$rect = New-Object System.Drawing.Rectangle(8, 8, 240, 240)
|
|
for ($i = 0; $i -lt 8; $i++) {
|
|
$brush = New-Object System.Drawing.SolidBrush([System.Drawing.ColorTranslator]::FromHtml($colors[$i]))
|
|
$g.FillPie($brush, $rect, ($i * 45 - 90), 46)
|
|
$brush.Dispose()
|
|
}
|
|
$white = New-Object System.Drawing.SolidBrush([System.Drawing.Color]::White)
|
|
$g.FillEllipse($white, 78, 78, 100, 100)
|
|
$white.Dispose()
|
|
$g.Dispose()
|
|
$out = Join-Path (Split-Path -Parent $PSScriptRoot) 'src/OneClickRun.App/Assets/AppIcon.png'
|
|
$bmp.Save($out, [System.Drawing.Imaging.ImageFormat]::Png)
|
|
$bmp.Dispose()
|
|
Write-Host "icon saved to $out"
|