File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <#
2+ . SYNOPSIS
3+ Loops Colors
4+ . DESCRIPTION
5+ Loops thru potential hue adjustment for an input.
6+ #>
7+ param (
8+ [string ]
9+ $InputName ,
10+
11+ [timespan ]
12+ $Duration = " 00:00:02"
13+ )
14+
15+ if (-not $InputName -and $this -and $this.InputName ) {
16+ $InputName = $this.InputName
17+ }
18+
19+ if (-not $InputName -and $this -and $this.SourceName ) {
20+ $InputName = $this.SourceName
21+ }
22+
23+ if (-not $InputName ) { return }
24+
25+ Add-OBSColorFilter - FilterName " ColorLoop" - SourceName $InputName - ErrorAction SilentlyContinue | Out-Null
26+
27+ $StepCount = [Math ]::Ceiling($Duration.TotalMilliseconds / ([timespan ]::fromSeconds(1 / 30 ).TotalMilliseconds)) * 2
28+
29+ $stepSleep = $Duration.TotalMilliseconds / $StepCount
30+
31+ $hue = 0
32+ $hueIncrement = 360 / $StepCount
33+ @ (foreach ($stepNum in 1 .. $StepCount ) {
34+ $hue += $hueIncrement
35+ Set-OBSColorFilter - FilterName " ColorLoop" - SourceName $InputName - Hue $hue - PassThru
36+ Send-OBSSleep - SleepMillis $stepSleep - PassThru
37+ })
You can’t perform that action at this time.
0 commit comments