https://wiki.beyondunreal.com/w/index.php?action=history&feed=atom
Color - Revision history
2017-11-18T02:57:47Z
Revision history for this page on the wiki
MediaWiki 1.25.1
https://wiki.beyondunreal.com/Color?diff=44367&oldid=prev
113.22.250.67: /* Color operators */ In the first paragraph, changed "provides Provides" to "provides" only.
2011-04-06T23:55:02Z
<p><span dir="auto"><span class="autocomment">Color operators: </span> In the first paragraph, changed "provides Provides" to "provides" only.</span></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 23:55, 6 April 2011</td>
</tr><tr><td colspan="2" class="diff-lineno" id="L16" >Line 16:</td>
<td colspan="2" class="diff-lineno">Line 16:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>===Color operators===</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>===Color operators===</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; 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;"><div>[[Unreal Engine 3]] provides <del class="diffchange diffchange-inline">Provides </del>the <code>-</code> <code>*</code> <code>+</code> operators for colors and [[Unreal Engine 2]] only provides them if extending from [[Actor]].</div></td><td class='diff-marker'>+</td><td style="color:black; 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;"><div>[[Unreal Engine 3]] provides the <code>-</code> <code>*</code> <code>+</code> operators for colors and [[Unreal Engine 2]] only provides them if extending from [[Actor]].</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div><code>-</code> Substracts a color by another color e.g. <uscript>local Color BlueColor;</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div><code>-</code> Substracts a color by another color e.g. <uscript>local Color BlueColor;</div></td></tr>
</table>
113.22.250.67
https://wiki.beyondunreal.com/Color?diff=43917&oldid=prev
Eliot: Minor tweaks
2010-08-25T21:38:59Z
<p>Minor tweaks</p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 21:38, 25 August 2010</td>
</tr><tr><td colspan="2" class="diff-lineno" id="L1" >Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>The type '''color''' is not a built-in type, but a [[struct]] defined in the {{classgames|Object}} class of all Unreal Engine games.  </div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>The type '''color''' is not a built-in type, but a [[struct]] defined in the {{classgames|Object}} class of all Unreal Engine games.  </div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div><br><br></div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div><br><br></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; 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;"><div>The '''color''' [[struct]] is used for drawing certain things with the <del class="diffchange diffchange-inline">{{classgames|</del>Canvas<del class="diffchange diffchange-inline">}} </del>and <del class="diffchange diffchange-inline">{{classgames|</del>HUD<del class="diffchange diffchange-inline">}} </del>with a specified color that is set with the 4 members of type [[Types#Byte|byte]](or [[Types#Float|float]] for [[UE3:Object structs (UT3)#LinearColor|LinearColor]] struct) which are '''R'''(''Red''), '''G'''(''Green''), '''B'''(''Blue'') and '''A'''(''Alpha'').</div></td><td class='diff-marker'>+</td><td style="color:black; 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;"><div>The '''color''' [[struct]] is used for drawing certain things with the <ins class="diffchange diffchange-inline">[[</ins>Canvas<ins class="diffchange diffchange-inline">]] </ins>and <ins class="diffchange diffchange-inline">[[</ins>HUD<ins class="diffchange diffchange-inline">]] </ins>with a specified color that is set with the 4 members of type [[Types#Byte|byte]](or [[Types#Float|float]] for [[UE3:Object structs (UT3)#LinearColor|LinearColor]] struct) which are '''R'''(''Red''), '''G'''(''Green''), '''B'''(''Blue'') and '''A'''(''Alpha'').</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>'''Note:''' [[Unreal Engine 3]] games may also define other color-like structs, such as [[UE3:Object structs (UT3)#LinearColor|LinearColor]].</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>'''Note:''' [[Unreal Engine 3]] games may also define other color-like structs, such as [[UE3:Object structs (UT3)#LinearColor|LinearColor]].</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>==Color operations==</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>==Color operations==</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; 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;"><div>In [[Unreal Engine 2]] there are no built-in operators for color [[struct|structs]] except a few in <del class="diffchange diffchange-inline">{{classgames|</del>Actor<del class="diffchange diffchange-inline">}}</del>.</div></td><td class='diff-marker'>+</td><td style="color:black; 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;"><div>In [[Unreal Engine 2]] there are no built-in operators for color [[struct|structs]] except a few in <ins class="diffchange diffchange-inline">[[</ins>Actor<ins class="diffchange diffchange-inline">]]</ins>.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>===Making a color===</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>===Making a color===</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; 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;"><div>[[Unreal Engine 3]] provides a <code>MakeColor()</code> function in <del class="diffchange diffchange-inline">{{classgames|</del>Object<del class="diffchange diffchange-inline">}} </del>that can be used to make a color [[struct]] instance by passing independant RGBA components e.g. <uscript>local Color BlueColor;</div></td><td class='diff-marker'>+</td><td style="color:black; 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;"><div>[[Unreal Engine 3]] provides a <code>MakeColor()</code> function in <ins class="diffchange diffchange-inline">[[</ins>Object<ins class="diffchange diffchange-inline">]] </ins>that can be used to make a color [[struct]] instance by passing independant RGBA components e.g. <uscript>local Color BlueColor;</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>BlueColor = MakeColor( 0, 0, 255, 255 );</uscript> ''this will create a blue color and assign it to '''BlueColor'''''.</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>BlueColor = MakeColor( 0, 0, 255, 255 );</uscript> ''this will create a blue color and assign it to '''BlueColor'''''.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; 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;"><div>'''Note:''' [[Unreal Engine 2]] doesn't have function <code>MakeColor()</code> accessible from <del class="diffchange diffchange-inline">{{classgames|</del>Object<del class="diffchange diffchange-inline">}} </del>but in <del class="diffchange diffchange-inline">{{classgames|</del>Canvas<del class="diffchange diffchange-inline">}} </del>so change <code>MakeColor()</code> code to <code>Class'Canvas'.static.MakeColor()</code>.</div></td><td class='diff-marker'>+</td><td style="color:black; 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;"><div>'''Note:''' [[Unreal Engine 2]] doesn't have function <code>MakeColor()</code> accessible from <ins class="diffchange diffchange-inline">the [[</ins>Object<ins class="diffchange diffchange-inline">]] class, </ins>but <ins class="diffchange diffchange-inline">instead </ins>in <ins class="diffchange diffchange-inline">the [[</ins>Canvas<ins class="diffchange diffchange-inline">]] class, </ins>so change <ins class="diffchange diffchange-inline">the </ins><code>MakeColor()</code> code to <code>Class'Canvas'.static.MakeColor()</code>.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>===Color operators===</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>===Color operators===</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; 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;"><div>[[Unreal Engine 3]] provides Provides the <code>-</code> <code>*</code> <code>+</code> operators for colors and [[Unreal Engine 2]] only provides them if extending from <del class="diffchange diffchange-inline">{{classgames|</del>Actor<del class="diffchange diffchange-inline">}}</del>.</div></td><td class='diff-marker'>+</td><td style="color:black; 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;"><div>[[Unreal Engine 3]] provides Provides the <code>-</code> <code>*</code> <code>+</code> operators for colors and [[Unreal Engine 2]] only provides them if extending from <ins class="diffchange diffchange-inline">[[</ins>Actor<ins class="diffchange diffchange-inline">]]</ins>.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div><code>-</code> Substracts a color by another color e.g. <uscript>local Color BlueColor;</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div><code>-</code> Substracts a color by another color e.g. <uscript>local Color BlueColor;</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="L39" >Line 39:</td>
<td colspan="2" class="diff-lineno">Line 39:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>===Utilities===</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>===Utilities===</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; 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;"><div>Because of the lack of many color operations you can view a list of community made color operations at [[UnrealScript <del class="diffchange diffchange-inline">Utils</del>]] to use in your project.</div></td><td class='diff-marker'>+</td><td style="color:black; 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;"><div>Because of the lack of many color operations you can view a list of community made color operations at [[<ins class="diffchange diffchange-inline">:Category:</ins>UnrealScript <ins class="diffchange diffchange-inline">utils|UnrealScript utils</ins>]] to use in your project.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>==See also==</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>==See also==</div></td></tr>
</table>
Eliot
https://wiki.beyondunreal.com/Color?diff=43236&oldid=prev
Eliot: Created page with 'The type '''color''' is not a built-in type, but a struct defined in the {{classgames|Object}} class of all Unreal Engine games. <br><br> The '''color''' struct is used …'
2010-05-15T03:18:14Z
<p>Created page with 'The type '''color''' is not a built-in type, but a <a href="/Struct" class="mw-redirect" title="Struct">struct</a> defined in the {{classgames|Object}} class of all Unreal Engine games. <br><br> The '''color''' <a href="/Struct" class="mw-redirect" title="Struct">struct</a> is used …'</p>
<p><b>New page</b></p><div>The type '''color''' is not a built-in type, but a [[struct]] defined in the {{classgames|Object}} class of all Unreal Engine games. <br />
<br><br><br />
The '''color''' [[struct]] is used for drawing certain things with the {{classgames|Canvas}} and {{classgames|HUD}} with a specified color that is set with the 4 members of type [[Types#Byte|byte]](or [[Types#Float|float]] for [[UE3:Object structs (UT3)#LinearColor|LinearColor]] struct) which are '''R'''(''Red''), '''G'''(''Green''), '''B'''(''Blue'') and '''A'''(''Alpha'').<br />
<br />
'''Note:''' [[Unreal Engine 3]] games may also define other color-like structs, such as [[UE3:Object structs (UT3)#LinearColor|LinearColor]].<br />
<br />
==Color operations==<br />
In [[Unreal Engine 2]] there are no built-in operators for color [[struct|structs]] except a few in {{classgames|Actor}}.<br />
<br />
===Making a color===<br />
[[Unreal Engine 3]] provides a <code>MakeColor()</code> function in {{classgames|Object}} that can be used to make a color [[struct]] instance by passing independant RGBA components e.g. <uscript>local Color BlueColor;<br />
<br />
BlueColor = MakeColor( 0, 0, 255, 255 );</uscript> ''this will create a blue color and assign it to '''BlueColor'''''.<br />
<br />
'''Note:''' [[Unreal Engine 2]] doesn't have function <code>MakeColor()</code> accessible from {{classgames|Object}} but in {{classgames|Canvas}} so change <code>MakeColor()</code> code to <code>Class'Canvas'.static.MakeColor()</code>.<br />
<br />
===Color operators===<br />
[[Unreal Engine 3]] provides Provides the <code>-</code> <code>*</code> <code>+</code> operators for colors and [[Unreal Engine 2]] only provides them if extending from {{classgames|Actor}}.<br />
<br />
<code>-</code> Substracts a color by another color e.g. <uscript>local Color BlueColor;<br />
local Color BlackColor;<br />
<br />
BlueColor = MakeColor( 0, 0, 255, 255 );<br />
BlackColor = BlueColor - MakeColor( 0, 0, 255, 255 );</uscript> ''Subtracts the blue color from '''BlueColor''' and would become a black color assigned to '''BlackColor'''.''<br />
<br><br />
<code>*</code> Multiplies a color by the scalar (i.e. [[float]]) value e.g. <uscript>local Color BlueColor;<br />
<br />
BlueColor = MakeColor( 0, 0, 255, 255 );<br />
BlueColor = BlueColor * 0.5f;</uscript> ''Multiplies '''BlueColor''' by half thus '''BlueColor''' will become darkblue.''<br />
<br><br />
<code>+</code> Adds a color to a color e.g. <uscript>local Color BlueColor;<br />
local Color PurpleColor;<br />
<br />
BlueColor = MakeColor( 0, 0, 255, 255 );<br />
PurpleColor = BlueColor + MakeColor( 255, 0, 0, 255 );</uscript> ''Merges '''BlueColor''' with a red color and becomes purple then assigns to '''PurpleColor'''''. <br />
<br />
====Performance====<br />
Because the above operators are slow it is recommend to convert them to a [[Vector]] first and then use the vector operators instead of the color operators when you are making use of the same color and same operators a lot in one function.<br />
<br />
===Utilities===<br />
Because of the lack of many color operations you can view a list of community made color operations at [[UnrealScript Utils]] to use in your project.<br />
<br />
==See also==<br />
* [[LinearColor]]<br />
<br />
{{navbox unrealscript}}</div>
Eliot