Name: srcAnd

Type: keyword

Syntax: srcAnd

Summary: Specifies one of the <transfer mode|transfer modes> that can be used with the <ink> <property>.

Introduced: 1.0

OS: windows,linux,ios,android

Platforms: desktop,server,web,mobile

Example:
set the ink of graphic "Outline" to srcAnd

The result: Each component of the resulting color is equal to the result of this expression:.

Description:
Use the <srcAnd> <keyword> to make the light-colored parts of an object transparent.

The <ink> <property> determines how an <object|object's> colors combine with the colors of the <pixels> underneath the <object> to determine how the <object|object's> color is displayed.

When the <srcAnd> <transfer mode> is used, LiveCode performs a <bitAnd> operation on each component of the <object> color with the corresponding component of the color under the <object>.

object component bitAnd background component

The effect is that the lighter an object is, the more transparent it is. White parts of an object are completely transparent, and black parts are completely opaque.

For example, suppose an object's color is 45,0,255, and the color of the pixels under the object is 20,45,100. If the <srcAnd> <transfer mode> is used, the <object|object's> displayed color is 4,0,100 (the decimal equivalent).

The <srcAnd> mode can be used only on <Unix> and <Windows|Windows systems>. On <Mac OS|Mac OS systems>, <object|objects> whose <ink> <property> is set to this mode appear as though their <ink> were set to <noOp>.

References: noOp (keyword), notSrcCopy (keyword), ink (property), pixels (property), bitAnd (operator), object (object), property (glossary), keyword (glossary), Unix (glossary), Windows (glossary), Mac OS (glossary), transfer mode (glossary)

Tags: ui
