[0.17.42] Out-or-range tint makes animation invisible.

Bugs that are actually features.
Post Reply
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

[0.17.42] Out-or-range tint makes animation invisible.

Post by eradicator »

What?
An animation layer with "oversaturated" tint becomes invisible instead.
The other layers (shadow) are unaffected.

Code: Select all

data.raw['assembling-machine']['assembling-machine-3'].animation.layers[1].tint = {r=1,g=1.1,b=1,a=1},
shadowonly.png
shadowonly.png (31.34 KiB) Viewed 499 times

Hoped for Behavior
I was hoping tint could be used to multiply the original color channel to become brighter like this:

Code: Select all

new_green = math.min(1,old_green * green_tint_factor)

Actually expected Behavior
An out of range error.


Why?
In this thread there's a discussion about hue, and i was testing if it can actually be done. because it'd be awesomely useful if it could be done.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

Bilka
Factorio Staff
Factorio Staff
Posts: 3133
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: [0.17.42] Out-or-range tint makes animation invisible.

Post by Bilka »

Code: Select all

tint = {r=1,g=1.1,b=1,a=1}
The game is interpreting this as 1 out of 255 alpha, due to you going above 1 for the g. Don't go above 1 if you want to use 0-1 color values.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: [0.17.42] Out-or-range tint makes animation invisible.

Post by eradicator »

#$@&%*! I never realized the engine accepted the 1-255 range as everything in base seems to be converted to 0-1 range. "1.1" is a float though so it's not valid for that range, not that it matters i guess. Thanks for bothering to tell me :).
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

Post Reply

Return to “Not a bug”