<doc>
  <legacy_id>2470</legacy_id>
  <name>srcOrReverse</name>
  <type>keyword</type>
  <syntax>
  </syntax>
  <library></library>
  <objects>
  </objects>
  <synonyms>
  </synonyms>
  <classification>
    <category>Appearance &amp; Positioning</category>
  </classification>
  <references>
    <keyword tag="notSrcCopy">notSrcCopy Keyword</keyword>
  </references>
  <history>
    <introduced version="1.0">Added.</introduced>
  </history>
  <platforms>
    <windows/>
    <linux/>
    <ios/>
    <android/>
  </platforms>
  <classes>
    <desktop/>
    <server/>
    <web/>
    <mobile/>
  </classes>
  <security>
  </security>
  <summary>Specifies one of the <glossary tag="transfer mode">transfer modes</glossary> that can be used with the <property tag="ink">ink</property> <glossary tag="property">property</glossary>.</summary>
  <examples>
    <example>set the ink of card field ID 8 to srcOrReverse</example>
  </examples>
  <description>
    <p>Use the <b>srcOrReverse</b> <glossary tag="keyword">keyword</glossary> to invert the color underneath the dark-colored parts of an object.</p><p/><p><b>Comments:</b></p><p>The <b>ink</b> <glossary tag="property">property</glossary> determines how an <glossary tag="object">object's</glossary> colors combine with the colors of the <property tag="pixels">pixels</property> underneath the <glossary tag="object">object</glossary> to determine how the <glossary tag="object">object's</glossary> color is displayed.</p><p/><p>The <b>srcOrReverse</b> <glossary tag="transfer mode">transfer mode</glossary> performs the following steps to compute the color of each pixel:</p><p/><p>1. Each component of the color underneath the object--the number indicating the amount of red, green, or blue--is changed to its inverse. (If the color is expressed as three integers between zero and 255--one for each of red, green, and blue--then the inverse of each component is equal to 255 minus the component's value.)</p><p/><p>2. For each of the three components, the resulting number is converted to its binary equivalent, a string of ones and zeroes. The same is done for each component of the object color.</p><p/><p>3. LiveCode performs a <b>bitOr</b> <glossary tag="operation">operation</glossary> on each component of the object color with the corresponding component of the inverse color under the <glossary tag="object">object</glossary>. (A <glossary tag="bit">bit</glossary> is 1 if one or both of the corresponding <glossary tag="bit">bits</glossary> of the <glossary tag="object">object</glossary> color and the color underneath is 1. If both corresponding bits are zero, the resulting <glossary tag="bit">bit</glossary> is 0. )</p><p/><p>4. For each component, the resulting binary number is turned back into a decimal number, which is one of the three components--red, green, or blue--of the final color.</p><p/><p>The effect is that the darker an object is, the more transparent it is to the inverted color beneath. Black parts of an object completely invert the color underneath them, and white parts are completely opaque.</p><p/><p>For example, suppose an object's color is<code> 45,0,255</code>, and the color of the pixels under the object is<code> 20,45,100</code>. The binary equivalent of the object's color is</p><p><code>  00101101, 00000000, 11111111</code></p><p>and the binary equivalent of the inverse of the color underneath is</p><p><code>  </code>11101011<code>, </code>11010010<code>, </code>10011011</p><p>If the <b>srcOrReverse</b> <glossary tag="transfer mode">transfer mode</glossary> is used, the resulting <glossary tag="binary">binary</glossary> components are</p><p><code>  </code>11101111<code>, </code>11010010<code>, </code>11111111</p><p>and the object's displayed colo<code>r is 239,210</code>,255 (the decimal equivalent).</p><p/><p>The <b>srcOrReverse</b> mode can be used only on <glossary tag="Unix">Unix</glossary> and <glossary tag="Windows">Windows systems</glossary>. On <glossary tag="Mac OS">Mac OS systems</glossary>, <glossary tag="object">objects</glossary> whose <property tag="ink">ink</property> <glossary tag="property">property</glossary> is set to this mode appear as though their <property tag="ink">ink</property> were set to <keyword tag="srcCopy">srcCopy</keyword>.</p>
  </description>
</doc>