How to set screen color RBG as a variable

Howdy, folks! As suggested in the title. I'm trying to set the one of the RBG value as the trigger for an event. Is there a way to do this through script call?


@AndarSorry I mean anyone of them (RBG). The one I need would be gray and/or red
please give a better description of what you want to do - RGB are three values, not one, and it would be difficult to set it to a single variable, unless you use some sort of hue code which would have a different problem as well.


EDIT: @beornotbe your edit doesn't clear anything, it only creates more confusion. Especially as there is no grey, RGB stands for red-green-blue.


Please explain what you want to do, not how you want to do it - because I suspect that the solution will be a lot easier if you don't use the color codes.
@Andar


OK,I know it's not part of RBG, but it is still in the tainted screen command. What I try to do is a series of puzzle. Everytime the player do it wrong, the screen gets darker. If the player makes enough wrong guess the grayness will be maxed out, at the same time player will die. Currently I'm using a variable to count the failed attempt. With every failed attempt the variable +1, and the screen darken a bit. With every success the variable -1. This puzzle runs for three maps. After one success attempt, the player must move to the next room to complete another puzzle. But the screen color should remain the same. From test I did, I found the colors seems to stack if I don't clear them. I do want them to stack, but I don't want the grayness to reach maximum prematurely, not until the player made enough failed attempts. So instead of approach this from setting wrong attempts as variable, I'm thinking about setting the grayness of the screen as variable to trigger death. ( Sorry for the unclear description ,maybe I just did too many hours of RM in a roll so I can't think straight... )
yes, you can't thnk straight - because you're trying to use the tint just to store it back into a variable instead of using the earlier variable directly?


The best way here is to use an additional variable to keep the total change stored, and use that to condition the later events.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-set-screen-color-rbg-as-a-variable.66669/