https://wiki.bennugd.org/index.php?title=Color_find&feed=atom&action=history
Color find - Revision history
2024-03-29T12:40:53Z
Revision history for this page on the wiki
MediaWiki 1.36.2
https://wiki.bennugd.org/index.php?title=Color_find&diff=10670&oldid=prev
Kloppix at 17:24, 20 July 2012
2012-07-20T17:24:57Z
<p></p>
<p><b>New page</b></p><div>[[Category:functions]]<br />
[[Category:palettes]]<br />
[[Category:mod_map]]<br />
<br />
== Syntax ==<br />
<br />
'''INT''' color_find ( <'''BYTE''' red> , <'''BYTE''' green> , <'''BYTE''' blue> )<br />
<br />
== Description ==<br />
Match an RGB value to a particular palette index. This is usefull in 8 bit mode.<br />
<br />
The previous name [[find_color]]() is deprecated. <br />
<br />
== Parameters ==<br />
{| <br />
| '''BYTE''' red || - Level of red in the desired color from 0 to 255.<br />
|- <br />
| '''BYTE''' green || - Level of green in the desired color from 0 to 255.<br />
|- <br />
| '''BYTE''' blue || - Level of blue in the desired color from 0 to 255.<br />
|}<br />
<br />
== Returns ==<br />
'''INT''' : Returns the palette inxed of the color that corresponds with the rgb combination.<br />
<br />
<br />
== Example ==<br />
<br />
<pre><br />
IMPORT "mod_say";<br />
IMPORT "mod_debug";<br />
IMPORT "mod_key";<br />
IMPORT "mod_map";<br />
IMPORT "mod_video";<br />
IMPORT "mod_wm";<br />
IMPORT "mod_draw";<br />
IMPORT "mod_screen";<br />
IMPORT "mod_text";<br />
<br />
GLOBAL<br />
<br />
int map_id; // id code of the map to load<br />
<br />
int status; // status for debugging<br />
<br />
<br />
PROCESS main();<br />
<br />
BEGIN<br />
<br />
set_mode(320,200,32);<br />
<br />
// load the map<br />
map_id=load_map("3COCHE.MAP");<br />
<br />
status=color_find(0,0,0);<br />
say("color: "+status);<br />
status=color_find(0,252,0);<br />
say("color: "+status);<br />
status=color_find(0,67,0);<br />
say("color: "+status);<br />
status=color_find(0,243,0);<br />
say("color: "+status);<br />
status=color_find(0,10,0);<br />
say("color: "+status);<br />
status=color_find(255,252,0);<br />
say("color: "+status);<br />
status=color_find(100,252,100);<br />
say("color: "+status);<br />
<br />
<br />
END<br />
</pre><br />
<br />
<br />
{{Moduledocbox<br />
| module = mod_map<br />
}}</div>
Kloppix