Skip to content

Commit bc6f839

Browse files
docs: Updating README
2 parents 0040156 + 52a86b3 commit bc6f839

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

Gradient.types.ps1xml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,32 @@
2727
Stringifies the gradient
2828
.DESCRIPTION
2929
Gets the gradient as a string. By default, returns the CSS gradient.
30+
31+
If any arguments are passed and are properties of this object,
32+
they will be returned as strings.
33+
.EXAMPLE
34+
"$(gradient '#4488ff' '#224488')"
35+
.EXAMPLE
36+
(gradient '#4488ff' '#224488').ToString("html")
3037
#>
38+
param()
39+
40+
if ($args) {
41+
$anymatching = @(foreach ($arg in $args) {
42+
$thisArg = $this.$arg
43+
if ($thisArg) {
44+
if ($thisArg -is [xml]) {
45+
$thisArg.Outerxml
46+
} else {
47+
$thisArg
48+
}
49+
}
50+
})
51+
if ($anymatching) {
52+
return ($anymatching -as 'string[]' -join [Environment]::NewLine)
53+
}
54+
}
55+
3156
return "$($this.CSS)"
3257
</Script>
3358
</ScriptMethod>

0 commit comments

Comments
 (0)