Skip to content

Commit

Permalink
Update main.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
kiwiphoenix364 committed Sep 27, 2023
1 parent f727483 commit eb86d00
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,44 +18,44 @@ namespace blur {
//% expandableArgumentMode="toggle"
export function SetBlurFilter(size: number, ms = 25) {
size = Math.max(1, size)
if (ms < 25) {
ms = 25
if (ms < 33) {
ms = 33
}
memSize1 = (size - blurSize1) / (ms / 25)
for (let j = 0; j < (ms / 25); j++) {
memSize1 = (size - blurSize1) / (ms / 33)
for (let j = 0; j < (ms / 33); j++) {
blurSize1 += memSize1
pause(25)
pause(33)
}
}
//% block="blur in over $ms ms"
//% weight=2
//% ms.shadow="timePicker"
export function BlurIn(ms = 25) {
export function BlurIn(ms = 33) {
blurSize1 = 15
let size = 1
if (ms < 25) {
ms = 25
if (ms < 33) {
ms = 33
}
memSize1 = (size - blurSize1) / (ms / 25)
for (let j = 0; j < (ms / 25); j++) {
memSize1 = (size - blurSize1) / (ms / 33)
for (let j = 0; j < (ms / 33); j++) {
blurSize1 += memSize1
pause(25)
pause(33)
}
}

//% block="blur out over $ms ms"
//% weight=1
//% ms.shadow="timePicker"
export function BlurOut(ms = 25) {
export function BlurOut(ms = 33) {
blurSize1 = 1
let size = 15
if (ms < 25) {
ms = 25
if (ms < 33) {
ms = 33
}
memSize1 = (size - blurSize1) / (ms / 25)
for (let j = 0; j < (ms / 25); j++) {
memSize1 = (size - blurSize1) / (ms / 33)
for (let j = 0; j < (ms / 33); j++) {
blurSize1 += memSize1
pause(25)
pause(33)
}
}

Expand Down

0 comments on commit eb86d00

Please sign in to comment.