Skip to content

Commit

Permalink
Merge pull request #526 from Quenty/users/quenty/update
Browse files Browse the repository at this point in the history
feat: Add NumberSequenceUtils.scaleTransparency(sequence, scale)
  • Loading branch information
Quenty authored Jan 8, 2025
2 parents 0081f30 + 61e0ac8 commit 08ef8a4
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ jobs:
uses: actions/checkout@v2

- name: Setup Aftman
uses: ok-nick/setup-aftman@v0.3.0
uses: ok-nick/setup-aftman@v0.4.2
with:
version: "v0.2.7"
version: 'v0.3.0'
token: ${{ secrets.GITHUB_TOKEN }}

- name: Generate standard library
Expand Down
21 changes: 21 additions & 0 deletions src/numbersequenceutils/src/Shared/NumberSequenceUtils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,27 @@ function NumberSequenceUtils.scale(sequence, scale)
return NumberSequence.new(waypoints)
end

--[=[
Scale the transparency
@param sequence NumberSequence
@param scale number
@return NumberSequence
]=]
function NumberSequenceUtils.scaleTransparency(sequence, scale)
local waypoints = {}

local keypoints = sequence.Keypoints
for _, keypoint in pairs(keypoints) do
table.insert(waypoints, NumberSequenceKeypoint.new(
keypoint.Time,
Math.map(keypoint.Value, 0, 1, scale, 1),
keypoint.Envelope*scale))
end

return NumberSequence.new(waypoints)
end

--[=[
Generates a number sequence with stripes, which can be used in a variety of ways.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ jobs:
uses: actions/checkout@v2

- name: Setup Aftman
uses: ok-nick/setup-aftman@v0.3.0
uses: ok-nick/setup-aftman@v0.4.2
with:
version: 'v0.2.7'
version: 'v0.3.0'
token: $\{{ secrets.GITHUB_TOKEN }}

- name: Generate standard library
Expand Down

0 comments on commit 08ef8a4

Please sign in to comment.