Types/BlendMode: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(Split into own page)
 
(Removed old prototype docs)
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
A [[Types/string]] that determines how sprites/animations should blend with the background. The possible values are listed below.
<div class="stub"><p>'''The prototype docs have moved to a new website with an improved format.''' This documentation page can now be found here: [https://lua-api.factorio.com/latest/types/BlendMode.html https://lua-api.factorio.com/latest/types/BlendMode.html]


Note: Unless <code>premul_alpha</code> is set to false on the sprite/animation itself, Active_RGB is considered to be premultiplied with alpha.
</p><p>This wiki page is no longer updated and '''will be removed at some point in the future''', so please update your browser bookmarks or other links that sent you here. If you'd like to contribute to the new docs, you can leave your feedback [https://forums.factorio.com/viewforum.php?f=233 on the forums].</p></div>
 
== Possible values ==
=== normal ===
The result color is determined with the following formula:
<code>Result = Active_RGB * Active_Alpha + Background_RGB * ( 1 - Active_Alpha )</code>
 
=== additive ===
The result color is determined with the following formula:
<code>Result = Active_RGB + Background_RGB</code>
 
=== additive-soft ===
The result color is determined with the following formula:
<code>Result = Active_RGB * ( 1 - Background_RGB ) + Background_RGB</code>
 
=== multiplicative ===
The result color is determined with the following formula:
<code>Result = Active_RGB * Background_RGB</code>
 
=== overwrite ===
The result color is determined with the following formula:
<code>Result = Active_RGBA or Background_RGBA</code>

Latest revision as of 14:32, 25 October 2024

The prototype docs have moved to a new website with an improved format. This documentation page can now be found here: https://lua-api.factorio.com/latest/types/BlendMode.html

This wiki page is no longer updated and will be removed at some point in the future, so please update your browser bookmarks or other links that sent you here. If you'd like to contribute to the new docs, you can leave your feedback on the forums.