<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.runerealm.org/index.php?action=history&amp;feed=atom&amp;title=Module%3ARgba%2Fdoc</id>
	<title>Module:Rgba/doc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.runerealm.org/index.php?action=history&amp;feed=atom&amp;title=Module%3ARgba%2Fdoc"/>
	<link rel="alternate" type="text/html" href="https://wiki.runerealm.org/index.php?title=Module:Rgba/doc&amp;action=history"/>
	<updated>2026-04-30T18:39:19Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>https://wiki.runerealm.org/index.php?title=Module:Rgba/doc&amp;diff=34044&amp;oldid=prev</id>
		<title>Alex: Created page with &quot;{{Documentation}} {{Helper module |name = Rgba |fname1 = &lt;nowiki&gt;new(&amp;nbsp;red, [green|0], [blue|0], [alpha|1]&amp;nbsp;)&lt;/nowiki&gt;;;  &lt;nowiki&gt;new(&amp;nbsp;hex&amp;nbsp;)&lt;/nowiki&gt; |ftype1 = number/string, number/nil, number/nil, number/nil |fuse1 = Returns a new rgba object. Values &lt;code&gt;red&lt;/code&gt;, &lt;code&gt;green&lt;/code&gt; and &lt;code&gt;blue&lt;/code&gt; are in the range 0-255; &lt;code&gt;alpha&lt;/code&gt; is 0-1. It is also possible to give a hex string e.g. &lt;code&gt;#112233&lt;/code&gt; or &lt;code&gt;#11223344&lt;/code&gt;....&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.runerealm.org/index.php?title=Module:Rgba/doc&amp;diff=34044&amp;oldid=prev"/>
		<updated>2024-10-15T17:23:27Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{Documentation}} {{Helper module |name = Rgba |fname1 = &amp;lt;nowiki&amp;gt;new( red, [green|0], [blue|0], [alpha|1] )&amp;lt;/nowiki&amp;gt;;;  &amp;lt;nowiki&amp;gt;new( hex )&amp;lt;/nowiki&amp;gt; |ftype1 = number/string, number/nil, number/nil, number/nil |fuse1 = Returns a new rgba object. Values &amp;lt;code&amp;gt;red&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;green&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;blue&amp;lt;/code&amp;gt; are in the range 0-255; &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; is 0-1. It is also possible to give a hex string e.g. &amp;lt;code&amp;gt;#112233&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;#11223344&amp;lt;/code&amp;gt;....&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Documentation}}&lt;br /&gt;
{{Helper module&lt;br /&gt;
|name = Rgba&lt;br /&gt;
|fname1 = &amp;lt;nowiki&amp;gt;new(&amp;amp;nbsp;red, [green|0], [blue|0], [alpha|1]&amp;amp;nbsp;)&amp;lt;/nowiki&amp;gt;;; &lt;br /&gt;
&amp;lt;nowiki&amp;gt;new(&amp;amp;nbsp;hex&amp;amp;nbsp;)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|ftype1 = number/string, number/nil, number/nil, number/nil&lt;br /&gt;
|fuse1 = Returns a new rgba object. Values &amp;lt;code&amp;gt;red&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;green&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;blue&amp;lt;/code&amp;gt; are in the range 0-255; &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; is 0-1. It is also possible to give a hex string e.g. &amp;lt;code&amp;gt;#112233&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;#11223344&amp;lt;/code&amp;gt;. &lt;br /&gt;
When converted to a string with &amp;lt;code&amp;gt;tostring( rgba )&amp;lt;/code&amp;gt; it will return a string in the form &amp;lt;code&amp;gt;rgba(r,b,g,a)&amp;lt;/code&amp;gt; where r, g, b and a are filled in with numbers.&lt;br /&gt;
|fname2 = rgba:lighten(&amp;amp;nbsp;val&amp;amp;nbsp;)&lt;br /&gt;
|ftype2 = number&lt;br /&gt;
|fuse2 = Returns a new rgba object with its brightness changed. 1 is no change, 0 is complete black, 2 is double brightness, 1.1 is 10% more, 0.5 is halve, etc.&lt;br /&gt;
|fname3 = rgba:darken(&amp;amp;nbsp;val&amp;amp;nbsp;)&lt;br /&gt;
|ftype3 = number&lt;br /&gt;
|fuse3 = Returns a new rgba object with its brightness changed. 1 is no change, 0 is complete white, 2 is halve brightness, 1.1 is 10% darker, 0.5 is double brightness, etc.&lt;br /&gt;
|fname4 = rgba:hueRotate(&amp;amp;nbsp;num&amp;amp;nbsp;)&lt;br /&gt;
|ftype4 = number&lt;br /&gt;
|fuse4 = Returns a new rgba object with its hue &amp;lt;code&amp;gt;num&amp;lt;/code&amp;gt; degrees rotated. Decimal values are allowed.&lt;br /&gt;
|fname5 = rgba:saturate(&amp;amp;nbsp;val&amp;amp;nbsp;)&lt;br /&gt;
|ftype5 = number&lt;br /&gt;
|fuse5 = Returns a new rgba object with its saturation changed. 1 is no change, 0 is greyscale, 2 is double saturation, 1.5 is 50% more, etc.&lt;br /&gt;
|fname6 = rgba:fade(&amp;amp;nbsp;val&amp;amp;nbsp;)&lt;br /&gt;
|ftype6 = number&lt;br /&gt;
|fuse6 = Returns a new rgba object with its alpha value set to &amp;lt;code&amp;gt;val&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;val&amp;lt;/code&amp;gt; is clipped to the range 0-1.&lt;br /&gt;
|fname7 = rgba:clone()&lt;br /&gt;
|ftype7 = N/A&lt;br /&gt;
|fuse7 = Returns a copy with the same values.&lt;br /&gt;
|example = &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;#039;lua&amp;#039;&amp;gt;&lt;br /&gt;
local rgba = require( &amp;#039;Module:Rgba&amp;#039; )&lt;br /&gt;
&lt;br /&gt;
local color1 = rgba.new( 126, 20, 6 )&lt;br /&gt;
mw.log( color1 ) --&amp;gt; &amp;#039;rgba(126,20,6,1)&amp;#039;&lt;br /&gt;
mw.log( color1:lighten( 1.3 ) ) --&amp;gt; &amp;#039;rgba(164,26,8,1)&amp;#039;&lt;br /&gt;
mw.log( color1:darken( 1.3 ) ) --&amp;gt; &amp;#039;rgba(97,15,5,1)&amp;#039;&lt;br /&gt;
mw.log( color1:hueRotate( 50 ) ) --&amp;gt; &amp;#039;rgba(126,120,6,1)&amp;#039;&lt;br /&gt;
mw.log( color1:saturate( 1.1 ) ) --&amp;gt; &amp;#039;rgba(132,15,0,1)&amp;#039;&lt;br /&gt;
mw.log( color1:fade( 0.3 ) ) --&amp;gt; &amp;#039;rgba(126,20,6,0.3)&amp;#039;&lt;br /&gt;
&lt;br /&gt;
local color2 = color1:lighten( 1.3 ):saturate( 1.1 ) -- Operations can be chained&lt;br /&gt;
mw.log( color2 ) --&amp;gt; &amp;#039;rgba(172,20,0,1)&amp;#039;&lt;br /&gt;
mw.log( color1 ) --&amp;gt; &amp;#039;rgba(126,20,6,1)&amp;#039; color1 is unchanged&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
</feed>