--- a/net/minecraft/ChatFormatting.java
+++ b/net/minecraft/ChatFormatting.java
@@ -110,6 +110,18 @@
         return name == null ? null : FORMATTING_BY_NAME.get(cleanName(name));
     }
 
+    // Paper start - add method to get by hex value
+    @Nullable public static ChatFormatting getByHexValue(int i) {
+        for (ChatFormatting value : values()) {
+            if (value.getColor() != null && value.getColor() == i) {
+                return value;
+            }
+        }
+
+        return null;
+    }
+    // Paper end - add method to get by hex value
+
     @Nullable
     public static ChatFormatting getById(int colorIndex) {
         if (colorIndex < 0) {
