for loop and user input in JES
I have a function
def decreaseRed(picture, amount): for p in getPixels(picture): value = getRed(p) setRed(p, value * amount)
I would like the function to ask the user to input the amount and then calculate that amount. I know this is probably simple but it has me stumped and I cant find the answer in a book.
From the JES Guide:
amount = requestNumber("Enter Amount:")
You could also consider:
amount = requestInteger("Amount: ")
amount =requestIntegerInRange("Amount in range min-max:", min, max)
if you you want to constrain the possible values.