Skip to content

Commit c643e65

Browse files
feat: Turtle.get/set_Opacity ( Fixes #115 )
1 parent 8a8b121 commit c643e65

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

Types/Turtle/get_Opacity.ps1

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<#
2+
.SYNOPSIS
3+
Gets the turtle opacity
4+
.DESCRIPTION
5+
Gets the opacity of the turtle path.
6+
#>
7+
if (-not $this.'.PathAttribute') {
8+
$this | Add-Member -MemberType NoteProperty -Name '.PathAttribute' -Value ([Ordered]@{}) -Force
9+
}
10+
if ($this.'.PathAttribute'.'opacity') {
11+
return $this.'.PathAttribute'.'opacity'
12+
} else {
13+
return 1.0
14+
}

Types/Turtle/set_Opacity.ps1

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<#
2+
.SYNOPSIS
3+
Sets the opacity
4+
.DESCRIPTION
5+
Sets the opacity of the path
6+
.EXAMPLE
7+
turtle forward 100 opacity 0.5 save ./dimLine.svg
8+
#>
9+
param(
10+
[double]
11+
$Opacity = 'nonzero'
12+
)
13+
14+
$this.PathAttribute = [Ordered]@{'opacity' = $Opacity}

0 commit comments

Comments
 (0)