Solved Bukkit color codes

Discussion in 'Plugin Development' started by P_S, Apr 23, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    P_S

    Hi, I need color list of bukkit colors in console like "" these colors are like unix colors but i can't find the list with these color codes.
     
  2. Offline

    P_S

    Yes this colors but in unix codes like is this one ""
     
  3. Why you need that?
     
  4. Offline

    P_S

    For translation colors from unix console to hexcolors on the website GUI
     
  5. 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)
     
  6. Offline

    P_S

    No it not possible because in output of console log are just these unix colors
     
  7. 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?)
     
  8. Offline

    P_S

    Yes every color got it's own color code. Yes will must do that by this way.
     
  9. :/ why oh why my dear Dennis Ritchie you didn't added bukkit color support :/
     
  10. Offline

    HackintoshMan

    Totally off topic…but I have a Hackintosh too!!!!
     
  11. Offline

    Addicted_24_7

    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
     
  12. Lolz!!
     
  13. Offline

    P_S

    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 ...
     
  14. Ultimate_n00b likes this.
  15. Offline

    P_S

    I got it ;) there is my result if will be someone interested of this topic ;) >>
    PHP:
    function translateMCColors($text) {
        
    $dictionary = array(
            
    '' => '<span style="color: #000000;">',    // Black
            
    '' => '<span style="color: #0000AA;">',    // Dark_Blue
            
    '' => '<span style="color: #00AA00;">',    // Dark_Green
            
    '' => '<span style="color: #00AAAA;">',    // Dark_Aqua
            
    '' => '<span style="color: #AA0000;">',    // Dark_Red
            
    '' => '<span style="color: #AA00AA;">',    // Purple
            
    '' => '<span style="color: #FFAA00;">',    // Gold
            
    '' => '<span style="color: #AAAAAA;">',    // Gray
            
    ''  => '<span style="color: #555555;">',    // Dakr_Gray
            
    ''  => '<span style="color: #5555FF;">',    // Blue
            
    ''  => '<span style="color: #55FF55;">',    // Green
            
    ''  => '<span style="color: #55FFFF;">',    // Aqua
            
    ''  => '<span style="color: #FF5555;">',    // Red
            
    ''  => '<span style="color: #FF55FF;">',    // Light_Purple
            
    ''  => '<span style="color: #FFFF55;">',    // Yellow
            
    ''  => '<span style="color: #FFFFFF;">',    // White
            
    ''        => '</span>',                            // End
        
    );
     
        
    $text str_replace(array_keys($dictionary), $dictionary$text);
     
        return 
    $text;
    }
     
    echo 
    "<p>" translateMCColors ($line['i'] . "</p>");
     
  16. look out that those colors may between builds, from the time I started monitoring them I build the following database at java:
    Code:java
    1. static
    2. {
    3. Map<String, String> replace = new HashMap<String, String>(39);
    4. replace.put("\033[30;22m", "§0");
    5. replace.put("\033[34;22m", "§1");
    6. replace.put("\033[32;22m", "§2");
    7. replace.put("\033[36;22m", "§3");
    8. replace.put("\033[31;22m", "§4");
    9. replace.put("\033[35;22m", "§5");
    10. replace.put("\033[33;22m", "§6");
    11. replace.put("\033[37;22m", "§7");
    12. replace.put("\033[30;1m", "§8");
    13. replace.put("\033[34;1m", "§9");
    14. replace.put("\033[32;1m", "§a");
    15. replace.put("\033[36;1m", "§b");
    16. replace.put("\033[31;1m", "§c");
    17. replace.put("\033[35;1m", "§d");
    18. replace.put("\033[33;1m", "§e");
    19. replace.put("\033[37;1m", "§f");
    20.  
    21. replace.put("\033[0;30;22m", "§0");
    22. replace.put("\033[0;34;22m", "§1");
    23. replace.put("\033[0;32;22m", "§2");
    24. replace.put("\033[0;36;22m", "§3");
    25. replace.put("\033[0;31;22m", "§4");
    26. replace.put("\033[0;35;22m", "§5");
    27. replace.put("\033[0;33;22m", "§6");
    28. replace.put("\033[0;37;22m", "§7");
    29. replace.put("\033[0;30;1m", "§8");
    30. replace.put("\033[0;34;1m", "§9");
    31. replace.put("\033[0;32;1m", "§a");
    32. replace.put("\033[0;36;1m", "§b");
    33. replace.put("\033[0;31;1m", "§c");
    34. replace.put("\033[0;35;1m", "§d");
    35. replace.put("\033[0;33;1m", "§e");
    36. replace.put("\033[0;37;1m", "§f");
    37.  
    38. replace.put("\033[30m", "§0");
    39. replace.put("\033[32m", "§2");
    40. replace.put("\033[36m", "§3");
    41. replace.put("\033[31m", "§4");
    42. replace.put("\033[35m", "§5");
    43. replace.put("\033[33m", "§6");
    44. replace.put("\033[37m", "§7");
    45. replace.put("\033[30m", "§8");
    46. replace.put("\033[34m", "§9");
    47. replace.put("\033[32m", "§a");
    48. replace.put("\033[36m", "§b");
    49. replace.put("\033[31m", "§c");
    50. replace.put("\033[35m", "§d");
    51. replace.put("\033[33m", "§e");
    52. replace.put("\033[37m", "§f");
    53.  
    54. replace.put("\033[5m", "§k");
    55. replace.put("\033[21m", "§l");
    56. replace.put("\033[9m", "§m");
    57. replace.put("\033[4m", "§n");
    58. replace.put("\033[3m", "§o");
    59. replace.put("\033[0;39m", "§r");
    60.  
    61. replace.put("\033[0m", "§r");
    62.  
    63. replace.put("\033[m", "");
    64.  
    65. replacements = Collections.unmodifiableMap(replace);
    66. }
     
  17. Offline

    P_S

    Nice work ;) I just updated my function for PHP by your db.

    PHP:
    function translateMCColors($text) {
        
    $dictionary = array(
            
    '' => '<span style="color: #000000;">'// §0 - Black
            
    '' => '<span style="color: #0000AA;">'// §1 - Dark_Blue
            
    '' => '<span style="color: #00AA00;">'// §2 - Dark_Green
            
    '' => '<span style="color: #00AAAA;">'// §3 - Dark_Aqua
            
    '' => '<span style="color: #AA0000;">'// §4 - Dark_Red
            
    '' => '<span style="color: #AA00AA;">'// §5 - Purple
            
    '' => '<span style="color: #FFAA00;">'// §6 - Gold
            
    '' => '<span style="color: #AAAAAA;">'// §7 - Gray
            
    '' => '<span style="color: #555555;">'// §8 - Dakr_Gray
            
    '' => '<span style="color: #5555FF;">'// §9 - Blue
            
    '' => '<span style="color: #55FF55;">'// §a - Green
            
    '' => '<span style="color: #55FFFF;">'// §b - Aqua
            
    '' => '<span style="color: #FF5555;">'// §c - Red
            
    '' => '<span style="color: #FF55FF;">'// §d - Light_Purple
            
    '' => '<span style="color: #FFFF55;">'// §e - Yellow
            
    '' => '<span style="color: #FFFFFF;">'// §f - White
           
            
    '' => '<span style="color: #000000;">'// §0 - Black
            
    '' => '<span style="color: #0000AA;">'// §1 - Dark_Blue
            
    '' => '<span style="color: #00AA00;">'// §2 - Dark_Green
            
    '' => '<span style="color: #00AAAA;">'// §3 - Dark_Aqua
            
    '' => '<span style="color: #AA0000;">'// §4 - Dark_Red
            
    '' => '<span style="color: #AA00AA;">'// §5 - Purple
            
    '' => '<span style="color: #FFAA00;">'// §6 - Gold
            
    '' => '<span style="color: #AAAAAA;">'// §7 - Gray
            
    '' => '<span style="color: #555555;">'// §8 - Dakr_Gray
            
    '' => '<span style="color: #5555FF;">'// §9 - Blue
            
    '' => '<span style="color: #55FF55;">'// §a - Green
            
    '' => '<span style="color: #55FFFF;">'// §b - Aqua
            
    '' => '<span style="color: #FF5555;">'// §c - Red
            
    '' => '<span style="color: #FF55FF;">'// §d - Light_Purple
            
    '' => '<span style="color: #FFFF55;">'// §e - Yellow
            
    '' => '<span style="color: #FFFFFF;">'// §f - White
           
            
    '' => ''// Obfuscated
            
    '' => '<b>'// Bold
            
    '' => '<s>'// Strikethrough
            
    '' => '<u>'// Underline
            
    '' => '<i>'// Italic
           
            
    '' => '</b></s></u></i></span>'// Reset
            
    '' => '</b></s></u></i></span>'// Reset
            
    '' => '</b></s></u></i></span>'// End
        
    );
       
        
    $text str_replace(array_keys($dictionary), $dictionary$text);
       
        return 
    $text;
    }
     
  18. Offline

    ThePico20



    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/>";
            }
        }
     
  19. Offline

    P_S

    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>";
            }
    }
     
Thread Status:
Not open for further replies.

Share This Page