设计完成30%

This commit is contained in:
2026-07-14 07:01:32 +08:00
parent 355f47976a
commit 1015e60ff7
95 changed files with 1991 additions and 349 deletions
+31 -3
View File
@@ -11,12 +11,15 @@ $backgrounds = @(
$icons = @(
'static/assets/foundation/transparent/auth-login-outline.png',
'static/assets/foundation/transparent/auth-wechat.png',
'static/assets/foundation/transparent/auth-button-corner.png',
'static/assets/foundation/transparent/auth-divider-knot.png',
'static/assets/foundation/transparent/auth-title-cloud.png'
)
$buttons = @(
'static/assets/foundation/opaque/a01-primary-button.png',
'static/assets/foundation/opaque/a01-secondary-button.png'
)
foreach ($asset in $backgrounds + $icons) {
foreach ($asset in $backgrounds + $icons + $buttons) {
if (-not (Test-Path -LiteralPath (Join-Path $root $asset))) {
throw "Missing A01 asset: $asset"
}
@@ -41,7 +44,6 @@ foreach ($asset in $icons) {
$bitmap.Dispose()
$expectedSize = switch ($asset) {
'static/assets/foundation/transparent/auth-button-corner.png' { @(160, 160) }
'static/assets/foundation/transparent/auth-divider-knot.png' { @(160, 96) }
'static/assets/foundation/transparent/auth-title-cloud.png' { @(200, 120) }
default { @(96, 96) }
@@ -52,4 +54,30 @@ foreach ($asset in $icons) {
Write-Output "PASS $asset transparent corners and visible artwork"
}
foreach ($asset in $buttons) {
$bitmap = [System.Drawing.Bitmap]::FromFile((Join-Path $root $asset))
$width = [int]$bitmap.Width
$height = [int]$bitmap.Height
$corners = @(
$bitmap.GetPixel(0, 0).A,
$bitmap.GetPixel(($width - 1), 0).A,
$bitmap.GetPixel(0, ($height - 1)).A,
$bitmap.GetPixel(($width - 1), ($height - 1)).A
)
$chromaPixels = 0
for ($y = 0; $y -lt $height; $y++) {
for ($x = 0; $x -lt $width; $x++) {
$pixel = $bitmap.GetPixel($x, $y)
if ($pixel.G - [Math]::Max($pixel.R, $pixel.B) -gt 80 -and $pixel.G -gt 120) { $chromaPixels++ }
}
}
$bitmap.Dispose()
$ratio = [double]$width / $height
if ([Math]::Abs($ratio - 4.492) -gt 0.01) { throw "$asset must keep the approved 4.492:1 button ratio." }
if (($corners | Where-Object { $_ -ne 255 }).Count -ne 0) { throw "$asset must have opaque outer corners." }
if ($chromaPixels -ne 0) { throw "$asset retains chroma-key green pixels." }
Write-Output "PASS $asset opaque corners and approved button ratio"
}
Write-Output 'A01-ASSET-ALPHA-AUDIT PASS'