Unity colour
Convert hex to Color and Color32 with a ready line of C#.
- Category
- SCP:SL, Steam and Unity
- Price
- free
The tool starts in your browser.
Everything is calculated in your browser. Nothing you type is sent to our server.
How to use it in three steps
The tool as a schematic with this page's example. Each step's number stands where you take it: in the fields, at the result or outside the tool.
Pick a colour or type a hex code.
Set the alpha.
Copy the C# line with Color or Color32.
#414df2 in Unity code
The same colour in two Unity types, computed by the tool's function: Color keeps channels from 0 to 1, Color32 from 0 to 255.
You enter
- Hex
- #414df2
- Alpha
- 1
Channels from 0 to 255
- Color32
- new Color32(65, 77, 242, 255)
Each pair of hex digits is one channel: 41, 4d, f2. Alpha 1 is 255.
Channels from 0 to 1
- Color
- new Color(0.2549f, 0.302f, 0.949f, 1f)
Each channel divided by 255, rounded to four places, trailing zeros dropped.
C#
new Color(0.2549f, 0.302f, 0.949f, 1f)new Color32(65, 77, 242, 255)
Questions
Related tools
The tool does one job. If the same thing should happen automatically in your bot, server or system, we build it.
Missing a tool you need?
Tell us what you want to calculate or generate. We will tell you whether a tool is enough or an integration in your system fits better.