Skip to content

Commit 5c21d30

Browse files
committed
Create README.md
1 parent b4178c3 commit 5c21d30

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
[English](README.md) | [Русский](README_RU.md)
2+
3+
# ColorUtility for Unity
4+
5+
## Description
6+
ColorUtility is a compact and efficient class designed for working with colors in Unity. It facilitates easy conversion of hexadecimal color codes (in RRGGBB format) to Unity `Color` objects. This tool is particularly useful when working with color values obtained from external sources, such as web APIs, user interfaces, or text files.
7+
8+
## Features
9+
- Simple conversion of hexadecimal color codes to Unity `Color` objects.
10+
- Verification of input format correctness to enhance error resilience.
11+
- Easily integrates into any Unity project.
12+
13+
## Installation
14+
To use `ColorUtility`, copy the `ColorUtility.cs` file into the `Scripts` or `Codebase` folder of your Unity project. Alternatively, you can download the ready-made `.package` in the Releases section.
15+
16+
## Usage Examples
17+
18+
### Converting a Hexadecimal String to a Color
19+
```csharp
20+
Color color = ColorUtility.HexToColor("FF5733");
21+
```
22+
23+
This code converts the string "FF5733" into a Unity Color object, which can now be used for setting colors in your game or application.
24+
25+
## Handling Incorrect Input Data
26+
If the passed string is incorrectly formatted, ColorUtility will return a white color and issue a warning in the Unity console.
27+
```csharp
28+
Color color = ColorUtility.HexToColor("IncorrectFormat"); // Returns Color.white
29+
```
30+
## Contributing to the Project
31+
Suggestions for improvement or feedback are welcome! If you have ideas to enhance ColorUtility, feel free to create a pull request or issue in the GitHub repository.
32+
33+
- Telegram channel - https://t.me/DevLogUnity
34+
- Chat in Telegram - https://t.me/DevLogUnity3d
35+
36+
License This project is distributed under the MIT License. See the LICENSE file for more details.
37+
38+
Author: RimuruDev

0 commit comments

Comments
 (0)