- 4
- Posts
- 5
- Years
- Seen Mar 6, 2020
I wasn't sure if this counted as a scripting question or not since according to the forum info you need to know what you're doing to label it like that...and I have no idea what I'm doing. Let me know if I need to change the tag though.
I'm a complete beginner to Essentials and started playing around with it a couple of days ago, and one thing I noticed was that, even after changing the sign window from its default one with a white background to one with a brown background, the text was still way too dark, making it difficult to read. I already did some googling for another problem I had earlier involving the SpriteWindow script, which looks like it has the answer to this problem too. It talks about determining the color of a background and then determining the text colors to use based on the darkness of the background. However, whatever threshold it is using to determine when to change the dark gray text to white, it's higher than I'd like it to be.
Basically, I want to lower the threshold so that the script will look at the window color I'm using and go, "Hey, that's too dark for our default dark gray text color. Let's switch the text color to white." Because, at the moment, it's looking at it and saying, "Looks just fine to me."
After squinting at the script and trying to figure out what it means--I know absolutely nothing about scripting or ruby--I identified a couple areas I think might be the keys to my problem. They mention a return (red*number + green*number + blue*number) < 128 a few times. I figure this means that the red, green, and blue values, times some decimal numbers, or averaged out depending on the area, must add up to below 128, which seems to be the magic number. I noticed it's mentioned a couple of other places, but I think those are only for window dimensions, which isn't what I'm worried about.
Anyway, I tried increasing the 128 value whenever I saw it paired with this red/green/blue combo, but the text didn't change to white unless I increased it all the way to 255, which I assume is the max. But then the text is white on white backgrounds too, which isn't what I want. So basically I'm stuck.
This may or may not be an easy fix for those that know how to script but I am not one of those people. I am interested in learning it at some point, but after wasting a few hours already tonight trying to find answers for this problem, I don't think now's a good time to start. And yes, I know you can change the text color for individual events and stuff, but I'm not planning on messing around with colors otherwise so this seems like the better solution.
Also, some pictures and stuff to help:
This is bad and by default is what happens.
This is what I want, but the text change only happens when I change the value of that 128 number to 255. And then it shows up as white on windows with white backgrounds too, which is bad.
These are the "maybe key areas" I mentioned before. The above area seems to affect sign windows like the brown one shown above, and probably dialogue windows too. The below area seems to affect things like location windows, which would also be useful to know how to lower the threshold of, but I figure it'd be the same type of fix. There's also something similar in the next section "Determine which text colours to use based on the darkness of the background" but after some messing around there, it doesn't look like it affects anything, so I didn't include it.
I'm a complete beginner to Essentials and started playing around with it a couple of days ago, and one thing I noticed was that, even after changing the sign window from its default one with a white background to one with a brown background, the text was still way too dark, making it difficult to read. I already did some googling for another problem I had earlier involving the SpriteWindow script, which looks like it has the answer to this problem too. It talks about determining the color of a background and then determining the text colors to use based on the darkness of the background. However, whatever threshold it is using to determine when to change the dark gray text to white, it's higher than I'd like it to be.
Basically, I want to lower the threshold so that the script will look at the window color I'm using and go, "Hey, that's too dark for our default dark gray text color. Let's switch the text color to white." Because, at the moment, it's looking at it and saying, "Looks just fine to me."
After squinting at the script and trying to figure out what it means--I know absolutely nothing about scripting or ruby--I identified a couple areas I think might be the keys to my problem. They mention a return (red*number + green*number + blue*number) < 128 a few times. I figure this means that the red, green, and blue values, times some decimal numbers, or averaged out depending on the area, must add up to below 128, which seems to be the magic number. I noticed it's mentioned a couple of other places, but I think those are only for window dimensions, which isn't what I'm worried about.
Anyway, I tried increasing the 128 value whenever I saw it paired with this red/green/blue combo, but the text didn't change to white unless I increased it all the way to 255, which I assume is the max. But then the text is white on white backgrounds too, which isn't what I want. So basically I'm stuck.
This may or may not be an easy fix for those that know how to script but I am not one of those people. I am interested in learning it at some point, but after wasting a few hours already tonight trying to find answers for this problem, I don't think now's a good time to start. And yes, I know you can change the text color for individual events and stuff, but I'm not planning on messing around with colors otherwise so this seems like the better solution.
Also, some pictures and stuff to help:
Spoiler:
![[PokeCommunity.com] Change dark gray text color to white depending on background/window darkness? [PokeCommunity.com] Change dark gray text color to white depending on background/window darkness?](https://i.imgur.com/kQKIACI.png)
This is bad and by default is what happens.
![[PokeCommunity.com] Change dark gray text color to white depending on background/window darkness? [PokeCommunity.com] Change dark gray text color to white depending on background/window darkness?](https://i.imgur.com/onZb6Qa.png)
This is what I want, but the text change only happens when I change the value of that 128 number to 255. And then it shows up as white on windows with white backgrounds too, which is bad.
![[PokeCommunity.com] Change dark gray text color to white depending on background/window darkness? [PokeCommunity.com] Change dark gray text color to white depending on background/window darkness?](https://i.imgur.com/kiezqJz.png)
These are the "maybe key areas" I mentioned before. The above area seems to affect sign windows like the brown one shown above, and probably dialogue windows too. The below area seems to affect things like location windows, which would also be useful to know how to lower the threshold of, but I figure it'd be the same type of fix. There's also something similar in the next section "Determine which text colours to use based on the darkness of the background" but after some messing around there, it doesn't look like it affects anything, so I didn't include it.