mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-27 19:45:22 +09:00
566 lines
15 KiB
HTML
566 lines
15 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
<html>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
|
<head>
|
|
<title>Reference</title>
|
|
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
|
</head>
|
|
<body>
|
|
|
|
<div id="container">
|
|
|
|
<div id="product">
|
|
<div id="product_logo"></div>
|
|
<div id="product_name"><big><b></b></big></div>
|
|
<div id="product_description"></div>
|
|
</div> <!-- id="product" -->
|
|
|
|
|
|
<div id="main">
|
|
|
|
|
|
<!-- Menu -->
|
|
|
|
<div id="navigation">
|
|
<br/>
|
|
<h1>ldoc</h1>
|
|
|
|
<ul>
|
|
<li><a href="../index.html">Index</a></li>
|
|
</ul>
|
|
|
|
<h2>Contents</h2>
|
|
<ul>
|
|
<li><a href="#Functions">Functions</a></li>
|
|
<li><a href="#Tables">Tables</a></li>
|
|
</ul>
|
|
|
|
|
|
<h2>Modules</h2>
|
|
<ul class="nowrap">
|
|
<li><a href="../modules/expcore.guiparts.center.html">expcore.guiparts.center</a></li>
|
|
<li><a href="../modules/expcore.guiparts.inputs.html">expcore.guiparts.inputs</a></li>
|
|
<li><a href="../modules/expcore.guiparts.left.html">expcore.guiparts.left</a></li>
|
|
<li><a href="../modules/expcore.guiparts.popup.html">expcore.guiparts.popup</a></li>
|
|
<li><a href="../modules/expcore.guiparts.toolbar.html">expcore.guiparts.toolbar</a></li>
|
|
<li><a href="../modules/expcore.commands.html">expcore.commands</a></li>
|
|
<li><a href="../modules/expcore.gui.html">expcore.gui</a></li>
|
|
<li><a href="../modules/expcore.ranking.html">expcore.ranking</a></li>
|
|
<li><a href="../modules/expcore.server.html">expcore.server</a></li>
|
|
<li><a href="../modules/expcore.sync.html">expcore.sync</a></li>
|
|
<li><a href="../modules/FSM.html">FSM</a></li>
|
|
<li><a href="../modules/ExpGamingLib.html">ExpGamingLib</a></li>
|
|
<li><strong>StdLib.Color</strong></li>
|
|
<li><a href="../modules/StdLib.Game.html">StdLib.Game</a></li>
|
|
<li><a href="../modules/StdLib.String.html">StdLib.String</a></li>
|
|
<li><a href="../modules/StdLib.Table.html">StdLib.Table</a></li>
|
|
<li><a href="../modules/StdLib.Time.html">StdLib.Time</a></li>
|
|
</ul>
|
|
<h2>Scripts</h2>
|
|
<ul class="nowrap">
|
|
<li><a href="../scripts/control.lua.html">control.lua</a></li>
|
|
<li><a href="../scripts/index.lua.html">index.lua</a></li>
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
<div id="content">
|
|
|
|
<h1>Module <code>StdLib.Color</code></h1>
|
|
<p>A defines module for retrieving colors by name.</p>
|
|
<p>
|
|
Extends the Factorio defines table.</p>
|
|
|
|
|
|
<h2><a href="#Functions">Functions</a></h2>
|
|
<table class="function_list">
|
|
<tr>
|
|
<td class="name" nowrap><a href="#set">set ([color=white[, alpha=1]])</a></td>
|
|
<td class="summary">Set a value for the alpha channel in the given color table.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#to_table">to_table (c_arr)</a></td>
|
|
<td class="summary">Converts a color in the array format to a color in the table format.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#from_rgb">from_rgb ([r=0[, g=0[, b=0[, a=255]]]])</a></td>
|
|
<td class="summary">Converts a color in the rgb format to a color table</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#from_hex">from_hex (hex[, alpha=1])</a></td>
|
|
<td class="summary">Get a color table with a hexadecimal string.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#to_rgb">to_rgb (color)</a></td>
|
|
<td class="summary">Converts a color in the color table format to rgb</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#to_hex">to_hex (color)</a></td>
|
|
<td class="summary">Converts a color in the color table format to hex</td>
|
|
</tr>
|
|
</table>
|
|
<h2><a href="#Tables">Tables</a></h2>
|
|
<table class="function_list">
|
|
<tr>
|
|
<td class="name" nowrap><a href="#defines.color">defines.color</a></td>
|
|
<td class="summary">A table of colors allowing retrieval by color name.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#defines.anticolor">defines.anticolor</a></td>
|
|
<td class="summary">Returns white for dark colors or black for lighter colors.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#defines.lightcolor">defines.lightcolor</a></td>
|
|
<td class="summary">Returns a lighter color of a named color</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#defines.textcolor">defines.textcolor</a></td>
|
|
<td class="summary">Returns a lighter color of a named color.</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<br/>
|
|
<br/>
|
|
|
|
|
|
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
|
|
|
<dl class="function">
|
|
<dt>
|
|
<a name = "set"></a>
|
|
<strong>set ([color=white[, alpha=1]])</strong>
|
|
</dt>
|
|
<dd>
|
|
Set a value for the alpha channel in the given color table.
|
|
`color.a` represents the alpha channel in the given color table.
|
|
<ul>
|
|
<li>If ***alpha*** is given, set `color.a` to it.
|
|
<li>If ***alpha*** is not given, and if the given color table does not have a value for `color.a`, set `color.a` to 1.
|
|
<li>If ***alpha*** is not given, and if the given color table already has a value for `color.a`, then leave `color.a` alone.
|
|
</ul>
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">color</span>
|
|
<span class="types"><a class="type" href="../modules/StdLib.Color.html#defines.color">defines.color</a> or <span class="type">Concepts.Color</span></span>
|
|
the color to configure
|
|
(<em>default</em> white)
|
|
</li>
|
|
<li><span class="parameter">alpha</span>
|
|
<span class="types"><span class="type">float</span></span>
|
|
the alpha value (*[0 - 1]*) to set for the given color
|
|
(<em>default</em> 1)
|
|
</li>
|
|
</ul>
|
|
|
|
<h3>Returns:</h3>
|
|
<ol>
|
|
|
|
<span class="types"><span class="type">a</span></span>
|
|
color table that has the specified value for the alpha channel
|
|
</ol>
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "to_table"></a>
|
|
<strong>to_table (c_arr)</strong>
|
|
</dt>
|
|
<dd>
|
|
Converts a color in the array format to a color in the table format.
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">c_arr</span>
|
|
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
|
|
the color to convert
|
|
</li>
|
|
</ul>
|
|
|
|
<h3>Returns:</h3>
|
|
<ol>
|
|
|
|
<span class="types"><span class="type">a</span></span>
|
|
converted color — { r = c\_arr[1], g = c\_arr[2], b = c\_arr[3], a = c\_arr[4] }
|
|
</ol>
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "from_rgb"></a>
|
|
<strong>from_rgb ([r=0[, g=0[, b=0[, a=255]]]])</strong>
|
|
</dt>
|
|
<dd>
|
|
Converts a color in the rgb format to a color table
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">r</span>
|
|
<span class="types"><span class="type">int</span></span>
|
|
0-255 red
|
|
(<em>default</em> 0)
|
|
</li>
|
|
<li><span class="parameter">g</span>
|
|
<span class="types"><span class="type">int</span></span>
|
|
0-255 green
|
|
(<em>default</em> 0)
|
|
</li>
|
|
<li><span class="parameter">b</span>
|
|
<span class="types"><span class="type">int</span></span>
|
|
0-255 blue
|
|
(<em>default</em> 0)
|
|
</li>
|
|
<li><span class="parameter">a</span>
|
|
<span class="types"><span class="type">int</span></span>
|
|
0-255 alpha
|
|
(<em>default</em> 255)
|
|
</li>
|
|
</ul>
|
|
|
|
<h3>Returns:</h3>
|
|
<ol>
|
|
|
|
<span class="types"><span class="type">Concepts.Color</span></span>
|
|
|
|
</ol>
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "from_hex"></a>
|
|
<strong>from_hex (hex[, alpha=1])</strong>
|
|
</dt>
|
|
<dd>
|
|
Get a color table with a hexadecimal string.
|
|
Optionally provide the value for the alpha channel.
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">hex</span>
|
|
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
|
|
hexadecimal color string (#ffffff, not #fff)
|
|
</li>
|
|
<li><span class="parameter">alpha</span>
|
|
<span class="types"><span class="type">float</span></span>
|
|
the alpha value to set; such that ***[ 0 ⋜ value ⋜ 1 ]***
|
|
(<em>default</em> 1)
|
|
</li>
|
|
</ul>
|
|
|
|
<h3>Returns:</h3>
|
|
<ol>
|
|
|
|
<span class="types"><span class="type">a</span></span>
|
|
color table with RGB converted from Hex and with alpha
|
|
</ol>
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "to_rgb"></a>
|
|
<strong>to_rgb (color)</strong>
|
|
</dt>
|
|
<dd>
|
|
Converts a color in the color table format to rgb
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">color</span>
|
|
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
|
|
the color to convert
|
|
</li>
|
|
</ul>
|
|
|
|
<h3>Returns:</h3>
|
|
<ol>
|
|
|
|
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
|
|
the color as rgb
|
|
</ol>
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "to_hex"></a>
|
|
<strong>to_hex (color)</strong>
|
|
</dt>
|
|
<dd>
|
|
Converts a color in the color table format to hex
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">color</span>
|
|
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.5">table</a></span>
|
|
the color to convert
|
|
</li>
|
|
</ul>
|
|
|
|
<h3>Returns:</h3>
|
|
<ol>
|
|
|
|
<span class="types"><a class="type" href="https://www.lua.org/manual/5.2/manual.html#6.4">string</a></span>
|
|
the color as hex
|
|
</ol>
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
</dl>
|
|
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
|
|
|
|
<dl class="function">
|
|
<dt>
|
|
<a name = "defines.color"></a>
|
|
<strong>defines.color</strong>
|
|
</dt>
|
|
<dd>
|
|
A table of colors allowing retrieval by color name.
|
|
|
|
|
|
<h3>Fields:</h3>
|
|
<ul>
|
|
<li><span class="parameter">white</span>
|
|
{r=1.00,g=1.00,b=1.00}
|
|
</li>
|
|
<li><span class="parameter">black</span>
|
|
{r=0.00,g=0.00,b=0.00}
|
|
</li>
|
|
<li><span class="parameter">darkgrey</span>
|
|
{r=0.25,g=0.25,b=0.25}
|
|
</li>
|
|
<li><span class="parameter">grey</span>
|
|
{r=0.50,g=0.50,b=0.50}
|
|
</li>
|
|
<li><span class="parameter">lightgrey</span>
|
|
{r=0.75,g=0.75,b=0.75}
|
|
</li>
|
|
<li><span class="parameter">red</span>
|
|
{r=1.00,g=0.00,b=0.00}
|
|
</li>
|
|
<li><span class="parameter">darkred</span>
|
|
{r=0.50,g=0.00,b=0.00}
|
|
</li>
|
|
<li><span class="parameter">lightred</span>
|
|
{r=1.00,g=0.50,b=0.50}
|
|
</li>
|
|
<li><span class="parameter">green</span>
|
|
{r=0.00,g=1.00,b=0.00}
|
|
</li>
|
|
<li><span class="parameter">darkgreen</span>
|
|
{r=0.00,g=0.50,b=0.00}
|
|
</li>
|
|
<li><span class="parameter">lightgreen</span>
|
|
{r=0.50,g=1.00,b=0.50}
|
|
</li>
|
|
<li><span class="parameter">blue</span>
|
|
{r=0.00,g=0.00,b=1.00}
|
|
</li>
|
|
<li><span class="parameter">darkblue</span>
|
|
{r=0.00,g=0.00,b=0.50}
|
|
</li>
|
|
<li><span class="parameter">lightblue</span>
|
|
{r=0.50,g=0.50,b=1.00}
|
|
</li>
|
|
<li><span class="parameter">orange</span>
|
|
{r=1.00,g=0.55,b=0.10}
|
|
</li>
|
|
<li><span class="parameter">yellow</span>
|
|
{r=1.00,g=1.00,b=0.00}
|
|
</li>
|
|
<li><span class="parameter">pink</span>
|
|
{r=1.00,g=0.00,b=1.00}
|
|
</li>
|
|
<li><span class="parameter">purple</span>
|
|
{r=0.60,g=0.10,b=0.60}
|
|
</li>
|
|
<li><span class="parameter">brown</span>
|
|
{r=0.60,g=0.40,b=0.10}
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "defines.anticolor"></a>
|
|
<strong>defines.anticolor</strong>
|
|
</dt>
|
|
<dd>
|
|
Returns white for dark colors or black for lighter colors.
|
|
|
|
|
|
<h3>Fields:</h3>
|
|
<ul>
|
|
<li><span class="parameter">green</span>
|
|
defines.color.black
|
|
</li>
|
|
<li><span class="parameter">grey</span>
|
|
defines.color.black
|
|
</li>
|
|
<li><span class="parameter">lightblue</span>
|
|
defines.color.black
|
|
</li>
|
|
<li><span class="parameter">lightgreen</span>
|
|
defines.color.black
|
|
</li>
|
|
<li><span class="parameter">lightgrey</span>
|
|
defines.color.black
|
|
</li>
|
|
<li><span class="parameter">lightred</span>
|
|
defines.color.black
|
|
</li>
|
|
<li><span class="parameter">orange</span>
|
|
defines.color.black
|
|
</li>
|
|
<li><span class="parameter">white</span>
|
|
defines.color.black
|
|
</li>
|
|
<li><span class="parameter">yellow</span>
|
|
defines.color.black
|
|
</li>
|
|
<li><span class="parameter">black</span>
|
|
defines.color.white
|
|
</li>
|
|
<li><span class="parameter">blue</span>
|
|
defines.color.white
|
|
</li>
|
|
<li><span class="parameter">brown</span>
|
|
defines.color.white
|
|
</li>
|
|
<li><span class="parameter">darkblue</span>
|
|
defines.color.white
|
|
</li>
|
|
<li><span class="parameter">darkgreen</span>
|
|
defines.color.white
|
|
</li>
|
|
<li><span class="parameter">darkgrey</span>
|
|
defines.color.white
|
|
</li>
|
|
<li><span class="parameter">darkred</span>
|
|
defines.color.white
|
|
</li>
|
|
<li><span class="parameter">pink</span>
|
|
defines.color.white
|
|
</li>
|
|
<li><span class="parameter">purple</span>
|
|
defines.color.white
|
|
</li>
|
|
<li><span class="parameter">red</span>
|
|
defines.color.white
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "defines.lightcolor"></a>
|
|
<strong>defines.lightcolor</strong>
|
|
</dt>
|
|
<dd>
|
|
Returns a lighter color of a named color
|
|
|
|
|
|
<h3>Fields:</h3>
|
|
<ul>
|
|
<li><span class="parameter">white</span>
|
|
defines.color.lightgrey
|
|
</li>
|
|
<li><span class="parameter">grey</span>
|
|
defines.color.darkgrey
|
|
</li>
|
|
<li><span class="parameter">lightgrey</span>
|
|
defines.color.grey
|
|
</li>
|
|
<li><span class="parameter">red</span>
|
|
defines.color.lightred
|
|
</li>
|
|
<li><span class="parameter">green</span>
|
|
defines.color.lightgreen
|
|
</li>
|
|
<li><span class="parameter">blue</span>
|
|
defines.color.lightblue
|
|
</li>
|
|
<li><span class="parameter">yellow</span>
|
|
defines.color.orange
|
|
</li>
|
|
<li><span class="parameter">pink</span>
|
|
defines.color.purple
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "defines.textcolor"></a>
|
|
<strong>defines.textcolor</strong>
|
|
</dt>
|
|
<dd>
|
|
Returns a lighter color of a named color.
|
|
|
|
|
|
<h3>Fields:</h3>
|
|
<ul>
|
|
<li><span class="parameter">info</span>
|
|
{r=0.21,g=0.95,b=1.00}
|
|
</li>
|
|
<li><span class="parameter">bg</span>
|
|
{r=0.00,g=0.00,b=0.00}
|
|
</li>
|
|
<li><span class="parameter">low</span>
|
|
{r=0.18,g=0.77,b=0.18}
|
|
</li>
|
|
<li><span class="parameter">med</span>
|
|
{r=1.00,g=0.89,b=0.26}
|
|
</li>
|
|
<li><span class="parameter">high</span>
|
|
{r=1.00,g=0.33,b=0.00}
|
|
</li>
|
|
<li><span class="parameter">crit</span>
|
|
{r=1.00,g=0.00,b=0.00}
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
</div> <!-- id="content" -->
|
|
</div> <!-- id="main" -->
|
|
<div id="about">
|
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
|
<i style="float:right;">Last updated 2018-05-30 00:08:40 </i>
|
|
</div> <!-- id="about" -->
|
|
</div> <!-- id="container" -->
|
|
</body>
|
|
</html>
|