/** Parses the specified style markup and returns the associated style. * The markup may be one of the Style enum value names, or it may be one of the Style enum value * names when {@code "bg_"} is prepended, or it may be one of the indexed colors in the 256 color palette. * @param str the case-insensitive style markup to convert, e.g. {@code "blue"} or {@code "bg_blue"}, * or {@code "46"} (indexed color) or {@code "0;5;0"} (RGB components of an indexed color) * @return the IStyle for the specified converter */ public static IStyle bg(String str) { try { return Style.valueOf(str.toLowerCase(ENGLISH)); } catch (Exception ignored) {} try { return Style.valueOf("bg_" + str.toLowerCase(ENGLISH)); } catch (Exception ignored) {} return new Palette256Color(false, str); } /** Parses the specified comma-separated sequence of style descriptors and returns the associated
/** Parses the specified style markup and returns the associated style. * The markup may be one of the Style enum value names, or it may be one of the Style enum value * names when {@code "fg_"} is prepended, or it may be one of the indexed colors in the 256 color palette. * @param str the case-insensitive style markup to convert, e.g. {@code "blue"} or {@code "fg_blue"}, * or {@code "46"} (indexed color) or {@code "0;5;0"} (RGB components of an indexed color) * @return the IStyle for the specified converter */ public static IStyle fg(String str) { try { return Style.valueOf(str.toLowerCase(ENGLISH)); } catch (Exception ignored) {} try { return Style.valueOf("fg_" + str.toLowerCase(ENGLISH)); } catch (Exception ignored) {} return new Palette256Color(true, str); } /** Parses the specified style markup and returns the associated style.
/** Parses the specified style markup and returns the associated style. * The markup may be one of the Style enum value names, or it may be one of the Style enum value * names when {@code "fg_"} is prepended, or it may be one of the indexed colors in the 256 color palette. * @param str the case-insensitive style markup to convert, e.g. {@code "blue"} or {@code "fg_blue"}, * or {@code "46"} (indexed color) or {@code "0;5;0"} (RGB components of an indexed color) * @return the IStyle for the specified converter */ public static IStyle fg(String str) { try { return Style.valueOf(str.toLowerCase(ENGLISH)); } catch (Exception ignored) {} try { return Style.valueOf("fg_" + str.toLowerCase(ENGLISH)); } catch (Exception ignored) {} return new Palette256Color(true, str); } /** Parses the specified style markup and returns the associated style.
/** Parses the specified style markup and returns the associated style. * The markup may be one of the Style enum value names, or it may be one of the Style enum value * names when {@code "bg_"} is prepended, or it may be one of the indexed colors in the 256 color palette. * @param str the case-insensitive style markup to convert, e.g. {@code "blue"} or {@code "bg_blue"}, * or {@code "46"} (indexed color) or {@code "0;5;0"} (RGB components of an indexed color) * @return the IStyle for the specified converter */ public static IStyle bg(String str) { try { return Style.valueOf(str.toLowerCase(ENGLISH)); } catch (Exception ignored) {} try { return Style.valueOf("bg_" + str.toLowerCase(ENGLISH)); } catch (Exception ignored) {} return new Palette256Color(false, str); } /** Parses the specified comma-separated sequence of style descriptors and returns the associated