Skip to content

Commit 0126c6a

Browse files
feat: Gradient.GradientType ( Fixes #16 )
1 parent 2b9f7a5 commit 0126c6a

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

Types/Gradient/Alias.psd1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@{
2+
GradientTypes = 'GradientType'
3+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<#
2+
.SYNOPSIS
3+
Gets the Gradient Type
4+
.DESCRIPTION
5+
Gets the Gradient Types found in the Gradient's input.
6+
7+
If no type is found, radial-gradient is the default.
8+
#>
9+
10+
$foundTypes = @(foreach ($in in $this.input) {
11+
if ($in -match $this.GradientTypePattern) {
12+
$in -replace '(?:-gradient)?$', '-gradient'
13+
}
14+
})
15+
16+
if (-not $foundTypes) {
17+
$foundTypes = @('radial-gradient')
18+
}
19+
return $foundTypes
20+

0 commit comments

Comments
 (0)