Skip to content

Commit 15eed7b

Browse files
StartAutomatingStartAutomating
authored andcommitted
feat: Gradient.json ( Fixes #6 )
1 parent 4d4f4d4 commit 15eed7b

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

Gradient.types.ps1xml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,28 @@ return $foundTypes
127127
'(?:repeating-)?(?>conic|linear|radial)(?:-gradient)?$'
128128
</GetScriptBlock>
129129
</ScriptProperty>
130+
<ScriptProperty>
131+
<Name>JSON</Name>
132+
<GetScriptBlock>
133+
&lt;#
134+
.SYNOPSIS
135+
Gets a json gradient
136+
.DESCRIPTION
137+
Gets the gradient in JavaScript Object Notation (JSON)
138+
139+
This describes the gradient as a background-image with the css inline in a string.
140+
141+
This should work seamlessly with
142+
[Element.animate](https://developer.mozilla.org/en-US/docs/Web/API/Element/animate)
143+
to allow you to animate a gradient change.
144+
.LINK
145+
https://developer.mozilla.org/en-US/docs/Web/API/Element/animate
146+
#&gt;
147+
@{
148+
'background-image' = "$($this.CSS)"
149+
} | ConvertTo-Json
150+
</GetScriptBlock>
151+
</ScriptProperty>
130152
<ScriptProperty>
131153
<Name>SVG</Name>
132154
<GetScriptBlock>

0 commit comments

Comments
 (0)