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