ProtoFlux:Color From Hex Code: Difference between revisions

From Resonite Wiki
Create Color From Hex Code ProtoFlux Node Page
 
Rewrite page
 
Line 1: Line 1:


Color From Hex Code is a ProtoFlux node that Makes a [[Type:Color|Color]] from a string hex code formatted according to the [https://en.wikipedia.org/wiki/Web_colors web color format]
 
{{#Invoke:ProtoFlux|GenerateUI
|Name=Color From Hex Code
|Category=Colors
|Inputs=
[
{"Name":"HexCode", "Type":"String"}
]
|Outputs=
[
{"Name":"Color", "Type":"color"},
{"Name":"Parsed", "Type":"bool"}
]
|}}
 
Color From Hex Code is a ProtoFlux node that parses a [https://en.wikipedia.org/wiki/Web_colors hex color code] such as "FFAEBB" into a [[Type:Color|Color]].


== Inputs ==
== Inputs ==
Line 6: Line 21:
=== HexCode ([[Type:String|String]]) ===
=== HexCode ([[Type:String|String]]) ===


Turns this hex code into a color. The hex code formatted to the [https://en.wikipedia.org/wiki/Web_colors web color format], with the last 2 "FF"s being used for Alpha.
The hex code to turn into a color. Turns this hex code into a color. The code must be a "#" followed by 3, 4, 6 or 8 hexadecimal digits. The 4 and 8 digit forms specify an alpha component, if not given the alpha component is taken to be 1.


== Outputs ==
== Outputs ==
Line 12: Line 27:
=== Color ([[Type:Color|Color]]) ===
=== Color ([[Type:Color|Color]]) ===


A color made from the provided HexCode ([[Type:String|String]]), or <code>[0,0,0,0]</code> if not parsed.
A color made from the provided hex code. This value is not defined and may have nonsense values if parsing failed (Parsed = false).


=== Parsed ([[Type:Bool|bool]]) ===
=== Parsed ([[Type:Bool|bool]]) ===


Whether the provided HexCode ([[Type:String|String]]) is a valid [https://en.wikipedia.org/wiki/Web_colors web color format] to parse.
True if parsing succeeded.
 
== See Also ==
 
* [[ProtoFlux:ColorX_From_Hex_Code|ColorX From Hex Code]]: for the [[Type:ColorX|ColorX]] type.
 
== Gallery ==


<gallery widths=480px heights=480px>
<gallery widths=480px heights=480px>

Latest revision as of 21:44, 25 February 2024


Color From Hex Code
HexCode
Color
Parsed
Colors

Color From Hex Code is a ProtoFlux node that parses a hex color code such as "FFAEBB" into a Color.

Inputs

HexCode (String)

The hex code to turn into a color. Turns this hex code into a color. The code must be a "#" followed by 3, 4, 6 or 8 hexadecimal digits. The 4 and 8 digit forms specify an alpha component, if not given the alpha component is taken to be 1.

Outputs

Color (Color)

A color made from the provided hex code. This value is not defined and may have nonsense values if parsing failed (Parsed = false).

Parsed (bool)

True if parsing succeeded.

See Also

Gallery