视觉审核完成30%
This commit is contained in:
@@ -18,13 +18,67 @@ $buttons = @(
|
||||
'static/assets/foundation/opaque/a01-primary-button.png',
|
||||
'static/assets/foundation/opaque/a01-secondary-button.png'
|
||||
)
|
||||
$v2Buttons = @(
|
||||
'static/assets/foundation/transparent/a01-primary-button-v2.png',
|
||||
'static/assets/foundation/transparent/a01-secondary-button-v2.png'
|
||||
)
|
||||
$v3Skins = @(
|
||||
'static/assets/foundation/transparent/a01-scroll-primary-v3.png',
|
||||
'static/assets/foundation/transparent/a01-scroll-secondary-v3.png',
|
||||
'static/assets/foundation/transparent/a01-scroll-toast-v3.png',
|
||||
'static/assets/modules/auth/transparent/a01-scroll-dialog-v3.png'
|
||||
)
|
||||
|
||||
foreach ($asset in $backgrounds + $icons + $buttons) {
|
||||
foreach ($asset in $backgrounds + $icons + $buttons + $v2Buttons + $v3Skins) {
|
||||
if (-not (Test-Path -LiteralPath (Join-Path $root $asset))) {
|
||||
throw "Missing A01 asset: $asset"
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($asset in $v3Skins) {
|
||||
$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
|
||||
)
|
||||
$bitmap.Dispose()
|
||||
|
||||
$expectedSize = switch ($asset) {
|
||||
'static/assets/foundation/transparent/a01-scroll-primary-v3.png' { @(1866, 276) }
|
||||
'static/assets/foundation/transparent/a01-scroll-secondary-v3.png' { @(1866, 300) }
|
||||
'static/assets/foundation/transparent/a01-scroll-toast-v3.png' { @(1770, 246) }
|
||||
'static/assets/modules/auth/transparent/a01-scroll-dialog-v3.png' { @(1860, 1560) }
|
||||
}
|
||||
if ($width -ne $expectedSize[0] -or $height -ne $expectedSize[1]) { throw "$asset must be $($expectedSize[0]) x $($expectedSize[1])px." }
|
||||
if (($corners | Where-Object { $_ -ne 0 }).Count -ne 0) { throw "$asset must have transparent outer corners." }
|
||||
Write-Output "PASS $asset transparent corners and exact v3 slot ratio"
|
||||
}
|
||||
|
||||
foreach ($asset in $v2Buttons) {
|
||||
$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
|
||||
)
|
||||
$bitmap.Dispose()
|
||||
|
||||
$expectedSize = switch ($asset) {
|
||||
'static/assets/foundation/transparent/a01-primary-button-v2.png' { @(1866, 276) }
|
||||
'static/assets/foundation/transparent/a01-secondary-button-v2.png' { @(1866, 300) }
|
||||
}
|
||||
if ($width -ne $expectedSize[0] -or $height -ne $expectedSize[1]) { throw "$asset must be $($expectedSize[0]) x $($expectedSize[1])px." }
|
||||
if (($corners | Where-Object { $_ -ne 0 }).Count -ne 0) { throw "$asset must have transparent outer corners." }
|
||||
Write-Output "PASS $asset transparent corners and exact runtime ratio"
|
||||
}
|
||||
|
||||
foreach ($asset in $icons) {
|
||||
$bitmap = [System.Drawing.Bitmap]::FromFile((Join-Path $root $asset))
|
||||
$width = [int]$bitmap.Width
|
||||
|
||||
Reference in New Issue
Block a user