| 1234567891011121314151617181920212223242526272829303132333435 |
- # Source for the committed navigation PNG assets; run from the project root.
- Add-Type -AssemblyName System.Drawing
- $assetDirectory = Join-Path $PSScriptRoot '../src/assets/tab'
- [System.IO.Directory]::CreateDirectory($assetDirectory) | Out-Null
- foreach ($kind in @('home', 'profile')) {
- foreach ($active in @($false, $true)) {
- $bitmap = New-Object System.Drawing.Bitmap 81, 81
- $canvas = [System.Drawing.Graphics]::FromImage($bitmap)
- $canvas.SmoothingMode = [System.Drawing.Drawing2D.SmoothingMode]::AntiAlias
- $canvas.Clear([System.Drawing.Color]::Transparent)
- $accent = if ($active) { '#873cff' } else { '#92929c' }
- $brush = New-Object System.Drawing.SolidBrush ([System.Drawing.ColorTranslator]::FromHtml($accent))
- if ($kind -eq 'home') {
- $roofBrush = New-Object System.Drawing.SolidBrush ([System.Drawing.ColorTranslator]::FromHtml($(if ($active) { '#ff875f' } else { '#c6b8b0' })))
- $wallBrush = New-Object System.Drawing.SolidBrush ([System.Drawing.ColorTranslator]::FromHtml($(if ($active) { '#ffe2b2' } else { '#e4dfd9' })))
- $doorBrush = New-Object System.Drawing.SolidBrush ([System.Drawing.ColorTranslator]::FromHtml($(if ($active) { '#61cbb5' } else { '#a8bfb8' })))
- $roof = [System.Drawing.PointF[]]@((New-Object System.Drawing.PointF 8, 38), (New-Object System.Drawing.PointF 40, 9), (New-Object System.Drawing.PointF 73, 38), (New-Object System.Drawing.PointF 65, 43), (New-Object System.Drawing.PointF 40, 21), (New-Object System.Drawing.PointF 16, 44))
- $canvas.FillRectangle($wallBrush, 20, 36, 42, 35)
- $canvas.FillPolygon($roofBrush, $roof)
- $canvas.FillRectangle($doorBrush, 34, 48, 14, 23)
- $canvas.FillRectangle($roofBrush, 55, 13, 7, 17)
- $roofBrush.Dispose(); $wallBrush.Dispose(); $doorBrush.Dispose()
- } else {
- $canvas.FillEllipse($brush, 27, 9, 28, 32)
- $canvas.FillEllipse($brush, 22, 28, 9, 12)
- $canvas.FillEllipse($brush, 51, 28, 9, 12)
- $canvas.FillEllipse($brush, 15, 43, 52, 42)
- $canvas.FillRectangle($brush, 15, 62, 52, 11)
- }
- $suffix = if ($active) { '-active' } else { '' }
- $bitmap.Save((Join-Path $assetDirectory "$kind$suffix.png"), [System.Drawing.Imaging.ImageFormat]::Png)
- $brush.Dispose(); $canvas.Dispose(); $bitmap.Dispose()
- }
- }
|