File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
src/main/java/me/croabeast/prismatic Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -334,6 +334,21 @@ public boolean startsWithColor(String string) {
334334 return matcher .find ();
335335 }
336336
337+ /**
338+ * Retrieves the start color code found in the provided string.
339+ *
340+ * @param string the string to search for color codes
341+ * @return the start color code as a {@link String}, or {@code null} if none is found
342+ */
343+ @ Nullable
344+ public String getStartColor (String string ) {
345+ string = colorize (string );
346+ Matcher matcher = Pattern .compile (COLOR_PATTERN ).matcher (string );
347+ String color = null ;
348+ if (matcher .find ()) color = matcher .group ();
349+ return color ;
350+ }
351+
337352 /**
338353 * Retrieves the end color code found in the provided string.
339354 *
You can’t perform that action at this time.
0 commit comments