Skip to content

Commit e60adc2

Browse files
StartAutomatingStartAutomating
authored andcommitted
feat: Gradient.GradientType ( Fixes #16 )
1 parent 0126c6a commit e60adc2

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

Gradient.types.ps1xml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,36 @@
33
<Type>
44
<Name>Gradient</Name>
55
<Members>
6+
<AliasProperty>
7+
<Name>GradientTypes</Name>
8+
<ReferencedMemberName>GradientType</ReferencedMemberName>
9+
</AliasProperty>
10+
<ScriptProperty>
11+
<Name>GradientType</Name>
12+
<GetScriptBlock>
13+
&lt;#
14+
.SYNOPSIS
15+
Gets the Gradient Type
16+
.DESCRIPTION
17+
Gets the Gradient Types found in the Gradient's input.
18+
19+
If no type is found, radial-gradient is the default.
20+
#&gt;
21+
22+
$foundTypes = @(foreach ($in in $this.input) {
23+
if ($in -match $this.GradientTypePattern) {
24+
$in -replace '(?:-gradient)?$', '-gradient'
25+
}
26+
})
27+
28+
if (-not $foundTypes) {
29+
$foundTypes = @('radial-gradient')
30+
}
31+
return $foundTypes
32+
33+
34+
</GetScriptBlock>
35+
</ScriptProperty>
636
<ScriptProperty>
737
<Name>GradientTypePattern</Name>
838
<GetScriptBlock>

0 commit comments

Comments
 (0)