Convert Tone Object ot Color Object

Hello since mod said that it's better to create new topic so i started, my problem is that i convert rpg maker xp script CCTS (time system) to vx ace and works fine, but the khas awesome effect works on different rule than my script (CCTS modify a tone depends on hour/month/season/climate) so the easiest way for me is to create a Color object from Tone object and i want to know how it's created from algorithm, what steps i need to do to successfully create new color object from Tone object (i believe it's possible since The Tone object somehow change Color object on screen). 
I'm not sure why you don't just use Tone.


But Tone is made up of red, green, blue and gray, and Color is made up of red, green, blue and alpha. I'm not sure how alpha and gray correspond, but I'd make a start by just inserting the numbers.


if myTone is the existing Tone object, I'd do this:

Code:
myColor = Color.new(myTone.red, myTone.green, myTone.blue, myTone.gray
then just muck around with the last setting a bit to see how you can manipulate the results.
I'm not sure why you don't just use Tone.

But Tone is made up of red, green, blue and gray, and Color is made up of red, green, blue and alpha. I'm not sure how alpha and gray correspond, but I'd make a start by just inserting the numbers.

if myTone is the existing Tone object, I'd do this:

myColor = Color.new(myTone.red, myTone.green, myTone.blue, myTone.graythen just muck around with the last setting a bit to see how you can manipulate the results.
 Why not use Tone, the answer is simple while CCTS changes tone, khas light effects use bitmap to cover screen and draw lights onto it, and the simple answer is wrong whilst tone also used red, green, blue channels the allowed value are from range -255 to 255 so it's not easy as directly use one value into another, or any other simple manipulation that comes to mind
You can't really convert a tone into a color as they work a bit differently. The corresponding color depends on the color you applied the tone to, so you'd have to calculate the tone color for each single pixel.

For example, if you use Tone.new(0, 0, 0, 255) to turn the background into a grayscale image, the corresponding color would be Color.new(X, X, X), where X depends on the brightness of a particular background pixel. You can't achieve that by applying a static color to the background.

Edit: Algorithm was a bit flawed, however ShadowLurk gave a good example on how the application of a color tone works:

http://forums.rpgmakerweb.com/index.php?/topic/25788-how-does-color-toning-work/?p=247916

Edit2: Confirmed that cremnophobia is right here, Sorry.
Thanks for the correction. 🙂
You can't really convert a tone into a color as they work a bit differently. The corresponding color depends on the color you applied the tone to, so you'd have to calculate the tone color for each single pixel.

For example, if you use Tone.new(0, 0, 0, 255) to turn the background into a grayscale image, the corresponding color would be Color.new(127, 127, 127, X), where X depends on the brightness of a particular background pixel. You can't achieve that by applying a static color to the background.

Edit: Algorithm was a bit flawed, however ShadowLurk gave a good example on how the application of a color tone works:

http://forums.rpgmakerweb.com/index.php?/topic/25788-how-does-color-toning-work/?p=247916
I read this and tried to ask question, but mods said that i should create new topic, anyway you said i can't achieve this effect with static color, so if it's true then the only resolve to my problem would be find any good time system that uses applying bitmap to screen instead of toning screen, but must say i searched web and didn't find any (some has advanced word in them but they just too bright in nights (and looks kinda weird during night time))
How about using a time system that doesn't tone, and then have timed checks that use Khas' Light script commands to change the display based on the time variables?
How about using a time system that doesn't tone, and then have timed checks that use Khas' Light script commands to change the display based on the time variables?
Is there system like that?? I mean i only found one system that might be called a proper time system and it's named advanced time system(or something like that), but problem was when i was testing it looked not so good during nights, so i think it's need a better choice of color.

btw. I don't require such features like making nights darker during new moon or bad weather(in that case also days will be darker), or different tint during seasons, or in different climate, but if i get a proper time system which looks good during night and also uses bitmap i would try to modify script to use that bitmap
Edit: Algorithm was a bit flawed, however ShadowLurk gave a good example on how the application of a color tone works:


http://forums.rpgmakerweb.com/index.php?/topic/25788-how-does-color-toning-work/?p=247916
He isn't correct either. It's common and fast to use this algorithm but it doesn't look as good as with differentially weighted color components (RGSS).

http://www.hbgames.org/forums/viewtopic.php?p=188077#p188077

Oh, by the way, the formulas for Tone, Color and stuff look like this:


tone:


Pixel + Tone


color:


(1 - Color.alpha) * Pixel + Color.alpha * Color


color does however not seem to modify the pixels alpha channel...


grayscale filtering:


Gray = Pixel.red * 0.299 + Pixel.green * 0.587 + Pixel.blue * 0.114


(1 - Tone.gray) * Gray + Tone.gray * Color

Original thread: https://forums.rpgmakerweb.com/threads/convert-tone-object-ot-color-object.40945/