File tree Expand file tree Collapse file tree 1 file changed +48
-0
lines changed
Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Original file line number Diff line number Diff line change 1+ <#
2+ . SYNOPSIS
3+ Gets Shapes as CSS
4+ . DESCRIPTION
5+ Gets the Shape as CSS.
6+ . EXAMPLE
7+ shape circle 50% |
8+ Select-Object -Expand CSS
9+ #>
10+ param ()
11+
12+ $ShapeType = ' shape'
13+
14+ # Get our gradient type
15+ $ShapeType = $this.ShapeType
16+ $shapeValues = @ (foreach ($in in $this.input ) {
17+ if ($in -notmatch $this.ShapeTypePattern ) {
18+ $in
19+ }
20+ })
21+
22+ if (-not $ShapeType ) { $ShapeType = ' shape' }
23+
24+ if ($ShapeType -eq ' polygon' ) {
25+ return " polygon($ (
26+ @ (for ($valueIndex = 0 ; $valueIndex -lt $shapeValues.Count ; $valueIndex += 2 ) {
27+ @ (if ($null -ne $shapeValues [$valueIndex + 1 ]) {
28+ $shapeValues [$valueIndex ]
29+ $shapeValues [$valueIndex + 1 ]
30+ } else {
31+ $shapeValues [$valueIndex ]
32+ $shapeValues [$valueIndex ]
33+ }) -join ' '
34+ }) -join ' , '
35+ ) )"
36+ }
37+
38+ $joinWith = if ($ShapeType -notin ' shape' ) {
39+ ' '
40+ } else {
41+ ' , '
42+ }
43+
44+ " $shapeType ($ (
45+ @ (
46+ $shapeValues
47+ ) -join $joinWith
48+ ) )"
You can’t perform that action at this time.
0 commit comments