Hi, I need color list of bukkit colors in console like "[0;37;22m" these colors are like unix colors but i can't find the list with these color codes.
You mean something like this: http://www.worldofminecraft.com/sit.../430b4ffe1d8313382e0c908834f87a69-614x508.png ?
Oh...but hmm can't you just get the hex values of the bukkit color codes? (I never worked with a unix console, except on my hackintosh so i don't know how it uses the bukkit colors and stuff so pardon me)
Ooh then I would just do a little test with all colors, write down all the outputs and then translate them to hex...(assuming every console ouput is another code per color?)
As far as colors go. Mess around with the color codes listed here on this site! This is the best refference to anything and everything related to colors and minecraft. I use this "§" symbol when i code an if that doesnt work using the default "&" is a good alternative. http://www.minecraftwiki.net/wiki/Formatting_codes
This page do not contains any of these codes it is unix codes for linux or mac and in console output im not able to se MC color codes ...
Those are ANSI color codes, nothing to do with Minecraft's colors. https://github.com/Bukkit/CraftBukk...bukkit/command/ColouredConsoleSender.java#L20
I got it there is my result if will be someone interested of this topic >> PHP: function translateMCColors($text) { $dictionary = array( '[0;30;22m' => '<span style="color: #000000;">', // Black '[0;34;22m' => '<span style="color: #0000AA;">', // Dark_Blue '[0;32;22m' => '<span style="color: #00AA00;">', // Dark_Green '[0;36;22m' => '<span style="color: #00AAAA;">', // Dark_Aqua '[0;31;22m' => '<span style="color: #AA0000;">', // Dark_Red '[0;35;22m' => '<span style="color: #AA00AA;">', // Purple '[0;33;22m' => '<span style="color: #FFAA00;">', // Gold '[0;37;22m' => '<span style="color: #AAAAAA;">', // Gray '[0;30;1m' => '<span style="color: #555555;">', // Dakr_Gray '[0;34;1m' => '<span style="color: #5555FF;">', // Blue '[0;32;1m' => '<span style="color: #55FF55;">', // Green '[0;36;1m' => '<span style="color: #55FFFF;">', // Aqua '[0;31;1m' => '<span style="color: #FF5555;">', // Red '[0;35;1m' => '<span style="color: #FF55FF;">', // Light_Purple '[0;33;1m' => '<span style="color: #FFFF55;">', // Yellow '[0;37;1m' => '<span style="color: #FFFFFF;">', // White '[m' => '</span>', // End ); $text = str_replace(array_keys($dictionary), $dictionary, $text); return $text;} echo "<p>" . translateMCColors ($line['i'] . "</p>");
look out that those colors may between builds, from the time I started monitoring them I build the following database at java: Code:java static { Map<String, String> replace = new HashMap<String, String>(39); replace.put("\033[30;22m", "§0"); replace.put("\033[34;22m", "§1"); replace.put("\033[32;22m", "§2"); replace.put("\033[36;22m", "§3"); replace.put("\033[31;22m", "§4"); replace.put("\033[35;22m", "§5"); replace.put("\033[33;22m", "§6"); replace.put("\033[37;22m", "§7"); replace.put("\033[30;1m", "§8"); replace.put("\033[34;1m", "§9"); replace.put("\033[32;1m", "§a"); replace.put("\033[36;1m", "§b"); replace.put("\033[31;1m", "§c"); replace.put("\033[35;1m", "§d"); replace.put("\033[33;1m", "§e"); replace.put("\033[37;1m", "§f"); replace.put("\033[0;30;22m", "§0"); replace.put("\033[0;34;22m", "§1"); replace.put("\033[0;32;22m", "§2"); replace.put("\033[0;36;22m", "§3"); replace.put("\033[0;31;22m", "§4"); replace.put("\033[0;35;22m", "§5"); replace.put("\033[0;33;22m", "§6"); replace.put("\033[0;37;22m", "§7"); replace.put("\033[0;30;1m", "§8"); replace.put("\033[0;34;1m", "§9"); replace.put("\033[0;32;1m", "§a"); replace.put("\033[0;36;1m", "§b"); replace.put("\033[0;31;1m", "§c"); replace.put("\033[0;35;1m", "§d"); replace.put("\033[0;33;1m", "§e"); replace.put("\033[0;37;1m", "§f"); replace.put("\033[30m", "§0"); replace.put("\033[32m", "§2"); replace.put("\033[36m", "§3"); replace.put("\033[31m", "§4"); replace.put("\033[35m", "§5"); replace.put("\033[33m", "§6"); replace.put("\033[37m", "§7"); replace.put("\033[30m", "§8"); replace.put("\033[34m", "§9"); replace.put("\033[32m", "§a"); replace.put("\033[36m", "§b"); replace.put("\033[31m", "§c"); replace.put("\033[35m", "§d"); replace.put("\033[33m", "§e"); replace.put("\033[37m", "§f"); replace.put("\033[5m", "§k"); replace.put("\033[21m", "§l"); replace.put("\033[9m", "§m"); replace.put("\033[4m", "§n"); replace.put("\033[3m", "§o"); replace.put("\033[0;39m", "§r"); replace.put("\033[0m", "§r"); replace.put("\033[m", ""); replacements = Collections.unmodifiableMap(replace); }
Nice work I just updated my function for PHP by your db. PHP: function translateMCColors($text) { $dictionary = array( '[30;22m' => '<span style="color: #000000;">', // §0 - Black '[34;22m' => '<span style="color: #0000AA;">', // §1 - Dark_Blue '[32;22m' => '<span style="color: #00AA00;">', // §2 - Dark_Green '[36;22m' => '<span style="color: #00AAAA;">', // §3 - Dark_Aqua '[31;22m' => '<span style="color: #AA0000;">', // §4 - Dark_Red '[35;22m' => '<span style="color: #AA00AA;">', // §5 - Purple '[33;22m' => '<span style="color: #FFAA00;">', // §6 - Gold '[37;22m' => '<span style="color: #AAAAAA;">', // §7 - Gray '[30;1m' => '<span style="color: #555555;">', // §8 - Dakr_Gray '[34;1m' => '<span style="color: #5555FF;">', // §9 - Blue '[32;1m' => '<span style="color: #55FF55;">', // §a - Green '[36;1m' => '<span style="color: #55FFFF;">', // §b - Aqua '[31;1m' => '<span style="color: #FF5555;">', // §c - Red '[35;1m' => '<span style="color: #FF55FF;">', // §d - Light_Purple '[33;1m' => '<span style="color: #FFFF55;">', // §e - Yellow '[37;1m' => '<span style="color: #FFFFFF;">', // §f - White '[0;30;22m' => '<span style="color: #000000;">', // §0 - Black '[0;34;22m' => '<span style="color: #0000AA;">', // §1 - Dark_Blue '[0;32;22m' => '<span style="color: #00AA00;">', // §2 - Dark_Green '[0;36;22m' => '<span style="color: #00AAAA;">', // §3 - Dark_Aqua '[0;31;22m' => '<span style="color: #AA0000;">', // §4 - Dark_Red '[0;35;22m' => '<span style="color: #AA00AA;">', // §5 - Purple '[0;33;22m' => '<span style="color: #FFAA00;">', // §6 - Gold '[0;37;22m' => '<span style="color: #AAAAAA;">', // §7 - Gray '[0;30;1m' => '<span style="color: #555555;">', // §8 - Dakr_Gray '[0;34;1m' => '<span style="color: #5555FF;">', // §9 - Blue '[0;32;1m' => '<span style="color: #55FF55;">', // §a - Green '[0;36;1m' => '<span style="color: #55FFFF;">', // §b - Aqua '[0;31;1m' => '<span style="color: #FF5555;">', // §c - Red '[0;35;1m' => '<span style="color: #FF55FF;">', // §d - Light_Purple '[0;33;1m' => '<span style="color: #FFFF55;">', // §e - Yellow '[0;37;1m' => '<span style="color: #FFFFFF;">', // §f - White '[5m' => '', // Obfuscated '[21m' => '<b>', // Bold '[9m' => '<s>', // Strikethrough '[4m' => '<u>', // Underline '[3m' => '<i>', // Italic '[0;39m' => '</b></s></u></i></span>', // Reset '[0m' => '</b></s></u></i></span>', // Reset '[m' => '</b></s></u></i></span>', // End ); $text = str_replace(array_keys($dictionary), $dictionary, $text); return $text;}
Please help me. I would like to use this code but it doesn't work. For display the line whith color I use this code: PHP: foreach($getLatestConsoleLogsWithLimit['success'] as $success) { if(!preg_match("[API Call]", $success['line'])) { translateMCColors($success['line']); echo $success['line']."<br/>"; } }
Use this code. I think it will solve your solution. PHP: foreach($getLatestConsoleLogsWithLimit['success'] as $success){ if (!preg_match("[API Call]", $success['line'])) { echo translateMCColors($success['line']) . "<br>"; }}