| 1234567891011121314151617181920212223242526272829303132333435363738 |
- # Reproducible vector-to-PNG artwork using the existing Neon Chrome palette.
- # Windows editor utility only; the exported PNG is platform independent.
- Add-Type -AssemblyName System.Drawing
- $assetRoot = [IO.Path]::GetFullPath((Join-Path $PSScriptRoot '../Art/UI'))
- $bitmap = [Drawing.Bitmap]::new(512,512,[Drawing.Imaging.PixelFormat]::Format32bppArgb)
- $g = [Drawing.Graphics]::FromImage($bitmap)
- $g.SmoothingMode = [Drawing.Drawing2D.SmoothingMode]::AntiAlias
- $g.Clear([Drawing.Color]::Transparent)
- function C([string]$hex) { [Drawing.ColorTranslator]::FromHtml($hex) }
- function Disc([int]$inset,[string[]]$colors,[single[]]$positions) {
- $r=[Drawing.RectangleF]::new($inset,$inset,512-2*$inset,512-2*$inset)
- $b=[Drawing.Drawing2D.LinearGradientBrush]::new($r,(C $colors[0]),(C $colors[-1]),75)
- $blend=[Drawing.Drawing2D.ColorBlend]::new($colors.Length)
- $blend.Colors=[Drawing.Color[]]@($colors | ForEach-Object { C $_ });$blend.Positions=$positions;$b.InterpolationColors=$blend
- $g.FillEllipse($b,$r);$b.Dispose()
- }
- foreach($glow in @(@(20,10,12),@(27,8,20),@(33,6,38))) {
- $pen=[Drawing.Pen]::new([Drawing.Color]::FromArgb($glow[2],255,45,168),$glow[1]);$g.DrawEllipse($pen,$glow[0],$glow[0],512-2*$glow[0],512-2*$glow[0]);$pen.Dispose()
- }
- Disc 40 @('#FCEFFF','#A685B7','#1C092C','#F5D4FF','#664A7F') @(0,.24,.52,.80,1)
- Disc 47 @('#A587BA','#F9F1FF','#69567F','#261731','#DCC3F2') @(0,.16,.42,.65,1)
- Disc 59 @('#21092F','#8B4A9E','#FF57B0') @(0,.65,1)
- Disc 64 @('#FF9CDE','#C32688','#FA58C6') @(0,.40,1)
- Disc 69 @('#180725','#4B1465','#170A28','#080511') @(0,.24,.72,1)
- $gloss=[Drawing.Drawing2D.GraphicsPath]::new();$gloss.AddEllipse(90,79,328,265)
- $glass=[Drawing.Drawing2D.PathGradientBrush]::new($gloss);$glass.CenterPoint=[Drawing.PointF]::new(178,125);$glass.CenterColor=[Drawing.Color]::FromArgb(87,203,112,247);$glass.SurroundColors=[Drawing.Color[]]@([Drawing.Color]::FromArgb(0,130,53,173));$g.FillPath($glass,$gloss);$glass.Dispose();$gloss.Dispose()
- $vertices=@(@(-135,-36),@(-36,-36),@(-36,-135),@(36,-135),@(36,-36),@(135,-36),@(135,36),@(36,36),@(36,135),@(-36,135),@(-36,36),@(-135,36))
- $points=[Drawing.PointF[]]@($vertices | ForEach-Object {[Drawing.PointF]::new(256+($_[0]-$_[1])*.7071068,250+($_[0]+$_[1])*.7071068)})
- $cross=[Drawing.Drawing2D.GraphicsPath]::new();$cross.AddPolygon($points)
- $shadow=$cross.Clone();$m=[Drawing.Drawing2D.Matrix]::new();$m.Translate(5,11);$shadow.Transform($m);$m.Dispose()
- $brush=[Drawing.SolidBrush]::new([Drawing.Color]::FromArgb(175,4,0,12));$g.FillPath($brush,$shadow);$brush.Dispose();$shadow.Dispose()
- $edge=[Drawing.Pen]::new((C '#BD87D6'),7);$edge.LineJoin=[Drawing.Drawing2D.LineJoin]::Round;$g.DrawPath($edge,$cross);$edge.Dispose()
- $face=[Drawing.Drawing2D.LinearGradientBrush]::new([Drawing.RectangleF]::new(128,122,256,256),(C '#FFFFFF'),(C '#9776B4'),90)
- $cb=[Drawing.Drawing2D.ColorBlend]::new(5);$cb.Colors=[Drawing.Color[]]@((C '#FFFFFF'),(C '#EEE6FA'),(C '#AE95C7'),(C '#F1E6FF'),(C '#9273A9'));$cb.Positions=[single[]]@(0,.30,.53,.79,1);$face.InterpolationColors=$cb;$g.FillPath($face,$cross);$face.Dispose()
- $rim=[Drawing.Pen]::new([Drawing.Color]::FromArgb(210,255,245,255),2.5);$rim.LineJoin=[Drawing.Drawing2D.LineJoin]::Round;$g.DrawPath($rim,$cross);$rim.Dispose();$cross.Dispose()
- $highlight=[Drawing.Pen]::new([Drawing.Color]::FromArgb(185,255,244,255),3);$g.DrawArc($highlight,44,44,424,424,194,95);$highlight.Dispose()
- $bitmap.Save((Join-Path $assetRoot 'NeonClose.png'),[Drawing.Imaging.ImageFormat]::Png)
- $g.Dispose();$bitmap.Dispose()
|