<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.spheredev.org/index.php?action=history&amp;feed=atom&amp;title=Color_masking</id>
	<title>Color masking - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.spheredev.org/index.php?action=history&amp;feed=atom&amp;title=Color_masking"/>
	<link rel="alternate" type="text/html" href="http://wiki.spheredev.org/index.php?title=Color_masking&amp;action=history"/>
	<updated>2026-11-24T22:49:16Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.9</generator>
	<entry>
		<id>http://wiki.spheredev.org/index.php?title=Color_masking&amp;diff=634&amp;oldid=prev</id>
		<title>Apollolux: /* Averaging Colors */ API link</title>
		<link rel="alternate" type="text/html" href="http://wiki.spheredev.org/index.php?title=Color_masking&amp;diff=634&amp;oldid=prev"/>
		<updated>2013-06-02T02:14:54Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Averaging Colors: &lt;/span&gt; API link&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 02:14, 2 June 2013&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l37&quot;&gt;Line 37:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 37:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Functions known to adhere to this principle include:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Functions known to adhere to this principle include:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*	ApplyColorMask()&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*	&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[API:&lt;/ins&gt;ApplyColorMask&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;|ApplyColorMask]]&lt;/ins&gt;()&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This principle is the basis of translucency techniques, making something appear semi-see-through. The idea is that colors are mixed in given proportions, to produce a color that is &amp;quot;in-between&amp;quot; the source and destination colors.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This principle is the basis of translucency techniques, making something appear semi-see-through. The idea is that colors are mixed in given proportions, to produce a color that is &amp;quot;in-between&amp;quot; the source and destination colors.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Apollolux</name></author>
	</entry>
	<entry>
		<id>http://wiki.spheredev.org/index.php?title=Color_masking&amp;diff=633&amp;oldid=prev</id>
		<title>Apollolux: Cleanup</title>
		<link rel="alternate" type="text/html" href="http://wiki.spheredev.org/index.php?title=Color_masking&amp;diff=633&amp;oldid=prev"/>
		<updated>2013-06-02T02:14:09Z</updated>

		<summary type="html">&lt;p&gt;Cleanup&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 02:14, 2 June 2013&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Color masking is a technique used by several Sphere objects to influence the final color of their graphical output, usually over multiple pixels of different colors. It is used in Sphere (misleadingly) in two ways:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[&lt;/ins&gt;Color masking&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]] &lt;/ins&gt;is a technique used by several Sphere objects to influence the final color of their graphical output, usually over multiple pixels of different colors. It is used in Sphere (misleadingly) in two ways:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#	Shaping the color channels of the source and destination pixel colors (e.g. SetPersonMask()).&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#	&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039;&lt;/ins&gt;Shaping the color channels&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039; &lt;/ins&gt;of the source and destination pixel colors (e.g. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[API:&lt;/ins&gt;SetPersonMask&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;|SetPersonMask]]&lt;/ins&gt;()).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#	Averaging the source and destination pixel colors (e.g. ApplyColorMask()). This is more commonly known as color blending.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#	&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039;&lt;/ins&gt;Averaging&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039; &lt;/ins&gt;the source and destination pixel colors (e.g. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[API:ApplyColorMask|&lt;/ins&gt;ApplyColorMask&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]]&lt;/ins&gt;()). This is more commonly known as &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039;&lt;/ins&gt;color blending&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039;&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Note that source refers to the color used for masking, while destination is used to describe what the mask is being applied to.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Note that &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;var&amp;gt;&lt;/ins&gt;source&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/var&amp;gt; &lt;/ins&gt;refers to the color used for masking, while &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;var&amp;gt;&lt;/ins&gt;destination&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/var&amp;gt; &lt;/ins&gt;is used to describe what the mask is being applied to.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;There is an important distinction between the two. Say the masking color was pure red (RGB of (255, 0, 0)). If the destination color is mixed the first way, the output is guaranteed to have zero in the green and blue channels. In contrast, any destination color mixed the second way with red may not just be red, i.e. the green and blue may be non-zero.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;There is an important distinction between the two. Say the masking color was pure red (RGB of (255, 0, 0)). If the destination color is mixed the first way, the output is guaranteed to have zero in the green and blue channels. In contrast, any destination color mixed the second way with red may not just be red, i.e. the green and blue may be non-zero.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Apollolux</name></author>
	</entry>
	<entry>
		<id>http://wiki.spheredev.org/index.php?title=Color_masking&amp;diff=632&amp;oldid=prev</id>
		<title>Apollolux: created from http://web.archive.org/web/20110802210543/http://www.spheredev.org/wiki/Color_masking</title>
		<link rel="alternate" type="text/html" href="http://wiki.spheredev.org/index.php?title=Color_masking&amp;diff=632&amp;oldid=prev"/>
		<updated>2013-06-02T02:07:14Z</updated>

		<summary type="html">&lt;p&gt;created from http://web.archive.org/web/20110802210543/http://www.spheredev.org/wiki/Color_masking&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Color masking is a technique used by several Sphere objects to influence the final color of their graphical output, usually over multiple pixels of different colors. It is used in Sphere (misleadingly) in two ways:&lt;br /&gt;
&lt;br /&gt;
#	Shaping the color channels of the source and destination pixel colors (e.g. SetPersonMask()).&lt;br /&gt;
#	Averaging the source and destination pixel colors (e.g. ApplyColorMask()). This is more commonly known as color blending.&lt;br /&gt;
&lt;br /&gt;
Note that source refers to the color used for masking, while destination is used to describe what the mask is being applied to.&lt;br /&gt;
&lt;br /&gt;
There is an important distinction between the two. Say the masking color was pure red (RGB of (255, 0, 0)). If the destination color is mixed the first way, the output is guaranteed to have zero in the green and blue channels. In contrast, any destination color mixed the second way with red may not just be red, i.e. the green and blue may be non-zero.&lt;br /&gt;
&lt;br /&gt;
Masking implies blocking of some sort, which means that the first definition is the &amp;quot;truer&amp;quot; of the two.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Shaping Color Channels==&lt;br /&gt;
Functions known to adhere to this principle include:&lt;br /&gt;
&lt;br /&gt;
*	[[API:SetPersonMask|SetPersonMask]]()&lt;br /&gt;
*	[[API:Font/setColorMask|Font.setColorMask]]()&lt;br /&gt;
&lt;br /&gt;
In shaping the channels of a color, the channel multipliers are first calculated:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
  red_factor = source.red   / 255&lt;br /&gt;
green_factor = source.green / 255&lt;br /&gt;
 blue_factor = source.blue  / 255&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The factors are then used to &amp;quot;shape&amp;quot; the channels of the destination pixel:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
new_color.red   = dest.red   * red_factor&lt;br /&gt;
new_color.green = dest.green * green_factor&lt;br /&gt;
new_color.blue  = dest.blue  * blue_factor&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Under this principle, when pure white (255, 255, 255) is used as a mask, the colors being masked will remain unchanged. Conversely, any mask color applied to a white destination pixel will cause the new color to be exactly the color of the mask. (Read that last sentence twice if you didn&amp;#039;t get it the first time.)&lt;br /&gt;
&lt;br /&gt;
==Averaging Colors==&lt;br /&gt;
Functions known to adhere to this principle include:&lt;br /&gt;
&lt;br /&gt;
*	ApplyColorMask()&lt;br /&gt;
&lt;br /&gt;
This principle is the basis of translucency techniques, making something appear semi-see-through. The idea is that colors are mixed in given proportions, to produce a color that is &amp;quot;in-between&amp;quot; the source and destination colors.&lt;br /&gt;
&lt;br /&gt;
For equal color ratios, the formulas are:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
new_color.red   = (source.red   + dest.red)   * 0.5&lt;br /&gt;
new_color.green = (source.green + dest.green) * 0.5&lt;br /&gt;
new_color.blue  = (source.blue  + dest.blue)  * 0.5&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For non-equal color ratios, the formulas change somewhat:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
new_color.red   = (src.red   * src_ratio + dest.red   * dest_ratio) / (src_ratio + dest_ratio)&lt;br /&gt;
new_color.green = (src.green * src_ratio + dest.green * dest_ratio) / (src_ratio + dest_ratio)&lt;br /&gt;
new_color.blue  = (src.blue  * src_ratio + dest.blue  * dest_ratio) / (src_ratio + dest_ratio)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Unsorted Functions==&lt;br /&gt;
The following functions use one of the two forms of color masking, but have not been sorted into one of the above two categories in operation:&lt;br /&gt;
&lt;br /&gt;
*	[[API:SetLayerMask|SetLayerMask]]()&lt;br /&gt;
*	[[API:SetColorMask|SetColorMask]]()&lt;br /&gt;
*	[[API:WindowStyle/setColorMask|WindowStyle.setColorMask]]()&lt;br /&gt;
*	[[API:Image/blitMask|Image.blitMask]]()&lt;br /&gt;
*	[[API:Image/transformBlitMask|Image.transformBlitMask]]()&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
*	Sphere [[API:Color|Color object]] (includes links to info about color blending)&lt;br /&gt;
*	[[Alpha channel]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Apollolux</name></author>
	</entry>
</feed>