01-05-2021



Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile, desktop, VR/AR, consoles or the Web, and connect with loyal and enthusiastic players and customers. Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable. Antivirus scan for mac. Color32 can be implicitly converted to and from Color.

A simple C# script that allows for creating UnityEngine Color32 variables via a hex code string

Getting Started

Unity Basic 2d Movement Script

UnityUnity

Getting ColorHex into your Unity project is as simple as dropping the ColorHex.cs file into your Assets/Scripts project folder.

Mollie

Usage

Unity Color

In order to have access to ColorHex in your script, make sure to include using ColorHexUtility; at the top of any script that requires it.

Unity Color32

Unity Color32 To Hex

Instead of using Color32’s constructor which requires you to pass byte values, you can now use the ColorHex constructor to pass in a hex code string. Since ColorHex is designed to be interoperable with Color32, an implementation can look like this: Great free games for mac.

Features

  • Reduces development time (and headaches) by letting you use a color code that can be copy-pasted straight from programs like Photoshop
  • Works with or without a preceding ‘#’ character
  • Supports alpha values (ex. #FFFFFF00)
  • Allows some text editor/IDE plugins to preview your color (ex. Color Info for Visual Studio Code