VulCode

Unity calculators

Hex to Color and Color32, a LayerMask for Physics.Raycast, Euler and Quaternion rotation, and jump gravity and velocity.

Category
SCP:SL, Steam and Unity
Price
free

Starting the tool...

Colour: 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.

Unity colour
What you enter
#414df2, alpha 1
  1. Pick a colour or type a hex code.

  2. Set the alpha.

What you get
new Color(0.2549f, 0.302f, 0.949f, 1f) new Color32(65, 77, 242, 255)
  1. 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)
What the tool does

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)
What the tool does

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

Each tab of 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.