Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Brightness not working
- wmsolivias
-
22 posts
Brightness not working
In one of my projects I have a sprite with this code.
The problem is that the sprite doesn't go white like I want it to. It does get brighter, though. If I try to raise the brightness, it won't go any higher. It should be at 100 brightness and therefore be white, but I don't understand why it doesn't work, and it was working before. Does anyone know why this is happening?
when I receive [message v]
repeat (10)
change [brightness v] effect by (10)
end
The problem is that the sprite doesn't go white like I want it to. It does get brighter, though. If I try to raise the brightness, it won't go any higher. It should be at 100 brightness and therefore be white, but I don't understand why it doesn't work, and it was working before. Does anyone know why this is happening?
- Burnout5858
-
100+ posts
Brightness not working
Could you link me to the project?
Also is the sprite set to 0 brightness?
Also is the sprite set to 0 brightness?
- wmsolivias
-
22 posts
Brightness not working
Link is here, and the brightness is set to 0 whenever the flag is clicked.
- deck26
-
1000+ posts
Brightness not working
I just added the following Yes, can you explain to me what you did?
when [ n] key pressed
broadcast [ fightintro]
It doesn't really matter which sprite this goes in. I tend to put things like that in the stage scripts if it doesn't obviously relate to a single sprite.
- wmsolivias
-
22 posts
Brightness not working
That doesn't work for me. Is it attached to anything?
- deck26
-
1000+ posts
Brightness not working
Here's a remix with that code in the Stage scripts - That doesn't work for me. Is it attached to anything?http://scratch.mit.edu/projects/39714832/
If you click the green flag and then press the ‘n’ key it's doing what I think you say you want but perhaps I'm missing something. The backdrop and sprite go white and then the backdrop changes and the flower appears.
- wmsolivias
-
22 posts
Brightness not working
Maybe it's my computer, because if I click the hero sprite in the editor it looks white, but it doesn't normally appear white.
- deck26
-
1000+ posts
Brightness not working
Might be worth trying to run it from the project page rather than in the editor as that can make a difference. Also, do you have the option of using a different browser? I'm using Firefox 34.0.5 on Windows Vista. Maybe it's my computer, because if I click the hero sprite in the editor it looks white, but it doesn't normally appear white.
Last edited by deck26 (Dec. 15, 2014 12:40:40)
- TheLogFather
-
1000+ posts
Brightness not working
I think the problem may be that there is a confusion of colour-spaces between the original and Stage3D (What used to be the beta) versions of the Scratch player. -If you switch off the Stage3D player (hit ctrl-M, or cmd-shift-M on Mac), then it works as expected.
More specifically, the “brightness” in the original player was actually controlling the “lightness” in the HSL colour-space, whereas I think the Stage3D player really is controlling the “value” (or “brightness”) in the HSV (or HSB) colour-space. Unfortunately, they mean something a bit different…
You can read about it here: http://en.wikipedia.org/wiki/HSL_and_HSV -note the first picture at top-right of page.
(In particular, the main difference is that setting full “lightness” in HSL will always give white, whereas setting full “value”/“brightness” in HSV/HSB will not. However, reducing “lightness” always leads to black, as does reducing “value”/“brightness”, so that's the same for both.)
This probably needs reporting as a bug…
More specifically, the “brightness” in the original player was actually controlling the “lightness” in the HSL colour-space, whereas I think the Stage3D player really is controlling the “value” (or “brightness”) in the HSV (or HSB) colour-space. Unfortunately, they mean something a bit different…

You can read about it here: http://en.wikipedia.org/wiki/HSL_and_HSV -note the first picture at top-right of page.
(In particular, the main difference is that setting full “lightness” in HSL will always give white, whereas setting full “value”/“brightness” in HSV/HSB will not. However, reducing “lightness” always leads to black, as does reducing “value”/“brightness”, so that's the same for both.)
This probably needs reporting as a bug…
Last edited by TheLogFather (Dec. 15, 2014 13:24:11)
- wmsolivias
-
22 posts
Brightness not working
Using command-shift-m fixed it! Thanks all of you for your help!
- PikaPal54
-
100+ posts
Brightness not working
Please stop necroposting. If you need help with brightness, This happened to me too!make a new topic.
- spartagamingplatform
-
42 posts
Brightness not working
I tried to correspond to this, but it didn't work. Here's my script that I used:
define set territory color to(color)(saturation)
set [color v] effect to ((color v) * (2))
set [brightness v] effect to ((brightness v) - ((brightness v) - (saturation v))
- Discussion Forums
- » Help with Scripts
-
» Brightness not working