<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/wiki/GetSearchLightColor?action=history&amp;feed=atom</id>
	<title>GetSearchLightColor - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/wiki/GetSearchLightColor?action=history&amp;feed=atom"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetSearchLightColor&amp;action=history"/>
	<updated>2026-09-16T20:25:46Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetSearchLightColor&amp;diff=82893&amp;oldid=prev</id>
		<title>Arran Fortuna: Created page with &quot;__NOTOC__ {{Client function}} This function gets the color of a searchlight element.  ==Syntax== &lt;syntaxhighlight lang=&quot;lua&quot;&gt; int int int int getSearchLightColor ( searchlight theSearchLight ) &lt;/syntaxhighlight&gt;  ===Required Arguments=== *'''theSearchLight''': the searchlight to get the color of.  ===Returns=== Returns four integers representing the red, green, blue and alpha components of the searchlight's color, each ranging from 0 to 255. Inval...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetSearchLightColor&amp;diff=82893&amp;oldid=prev"/>
		<updated>2026-09-16T09:53:49Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;__NOTOC__ {{Client function}} This function gets the color of a &lt;a href=&quot;/wiki/Element/Searchlight&quot; title=&quot;Element/Searchlight&quot;&gt;searchlight&lt;/a&gt; element.  ==Syntax== &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; int int int int getSearchLightColor ( searchlight theSearchLight ) &amp;lt;/syntaxhighlight&amp;gt;  ===Required Arguments=== *&amp;#039;&amp;#039;&amp;#039;theSearchLight&amp;#039;&amp;#039;&amp;#039;: the searchlight to get the color of.  ===Returns=== Returns four integers representing the red, green, blue and alpha components of the searchlight&amp;#039;s color, each ranging from 0 to 255. Inval...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function gets the color of a [[Element/Searchlight|searchlight]] element.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int int int int getSearchLightColor ( searchlight theSearchLight )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theSearchLight''': the searchlight to get the color of.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns four integers representing the red, green, blue and alpha components of the searchlight's color, each ranging from 0 to 255. Invalid arguments raise an error.&lt;br /&gt;
&lt;br /&gt;
The default color is red 200, green 200, blue 255 and alpha 0.&lt;br /&gt;
&lt;br /&gt;
{{Note|The alpha component is stored and returned, but does not affect the searchlight's appearance.}}&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example creates a searchlight above the player and displays its default color.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addCommandHandler(&amp;quot;getlightcolor&amp;quot;, function()&lt;br /&gt;
    local x, y, z = getElementPosition(localPlayer)&lt;br /&gt;
    local searchLight = createSearchLight(x, y, z + 10, x, y, z, 0, 5)&lt;br /&gt;
&lt;br /&gt;
    if not searchLight then&lt;br /&gt;
        return&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    local r, g, b, a = getSearchLightColor(searchLight)&lt;br /&gt;
    outputChatBox((&amp;quot;Searchlight color: R=%d, G=%d, B=%d, A=%d&amp;quot;):format(r, g, b, a))&lt;br /&gt;
&lt;br /&gt;
    -- Remove the demonstration light after 10 seconds.&lt;br /&gt;
    setTimer(destroyElement, 10000, 1, searchLight)&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
{{Client_searchlight_functions}}&lt;/div&gt;</summary>
		<author><name>Arran Fortuna</name></author>
	</entry>
</feed>