Difference between revisions of "SHIP:Sail:argb"

From Serious Documentation
Jump to: navigation, search
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 
{{SailFuncTableStart|}}<onlyinclude>
 
{{SailFuncTableStart|}}<onlyinclude>
|{{SailFunc|argb}}||{{DataType|Integer}} color ||style="text-align:center;"|v5.1.0||Creates a combined color integer from separate color channels.</onlyinclude>
+
|{{SailFunc|argb}}||{{DataType|Color}} color ||style="text-align:center;"|v5.1.0||Creates a combined color integer from separate color channels.</onlyinclude>
 
|}
 
|}
 
== See Also: ==
 
== See Also: ==
Line 8: Line 8:
 
*{{SailFunc|ceil}} {{SailFunc|floor}} {{SailFunc|mapRange}}
 
*{{SailFunc|ceil}} {{SailFunc|floor}} {{SailFunc|mapRange}}
 
== Prototype ==
 
== Prototype ==
{{DataType|Integer}} color = {{SailFunc|argb}}({{DataType|Integer}} alpha, {{DataType|Integer}} red, {{DataType|Integer}} green, {{DataType|Integer}} blue;
+
{{DataType|Color}} color = {{SailFunc|argb}}({{DataType|Integer}} alpha, {{DataType|Integer}} red, {{DataType|Integer}} green, {{DataType|Integer}} blue;
  
 
=== Parameters/Return Value ===
 
=== Parameters/Return Value ===
Line 25: Line 25:
 
|-
 
|-
 
! scope="col" style="text-align:left" | Return
 
! scope="col" style="text-align:left" | Return
! scope="col" style="text-align:left" | {{DataType|Integer}}
+
! scope="col" style="text-align:left" | {{DataType|Color}}
! scope="col" style="text-align:left" | an integer representation of the mixed color;
+
! scope="col" style="text-align:left" | color representation of the mixed color;
 
|}
 
|}
  
Line 40: Line 40:
 
! scope="col" style="text-align:left" | Notes
 
! scope="col" style="text-align:left" | Notes
 
|-
 
|-
|<code>{{SailFunc|argb}}(255, 255, 255, 0);</code> || -256 ||
+
|<code>myColor = {{SailFunc|argb}}(255, 0, 0, 0);</code> || 0xff000000 ||opaque black
 
|-
 
|-
|<code>{{SailFunc|argb}}(0, 255, 255, 255);</code> || 16776960 ||
+
|<code>myColor = {{SailFunc|argb}}(0, 255, 255, 255);</code> || 0x00ffffff || transparent white
 
|}
 
|}
  
 
[[Category:Numeric Functions]]
 
[[Category:Numeric Functions]]
[[Category:Canvas Functions]]
 

Revision as of 15:14, 11 October 2016

Function Returns Introduced Description
argb Color color v5.1.0 Creates a combined color integer from separate color channels.

See Also:

Prototype

Color color = argb(Integer alpha, Integer red, Integer green, Integer blue;

Parameters/Return Value

Parameter Data Type Description
alpha Integer Alpha channel
red Integer Red channel
blue Integer Green channel
green Integer Blue channel
Return Color color representation of the mixed color;

Detailed Description

The argb function combines each alpha, red, green, and blue channel into a single blended color.


Examples

Example Result Notes
myColor = argb(255, 0, 0, 0); 0xff000000 opaque black
myColor = argb(0, 255, 255, 255); 0x00ffffff transparent white