egui_from_hex
EGUI from Hex is a simple, very lightweight and compatible crate to add to any of your projects.
It is made to work with older versions of EGUI, as well as improve the current from_hex() function.
Usage
The syntax is literally just how you use Color32 normally.
Version 0.1.2 added error handling instead of defaulting to black there were any errors.
If this inconveniences you, you can use the unwrap() function, or switch back to the previous version.
Examples
Using the from_hex() function:
use HexColor;
let color = from_hex.unwrap;
Using the from_hex() function with error handling:
- Using the
matchstatement
use HexColor;
match from_hex
- Using the
if letstatement
use HexColor;
if let Ok = from_hex else
However, it's overkill to use the match or if let statements, you can just use the unwrap() function.
Note: Thank you for using my crate.