Solved Color.[color name] Confusion

Discussion in 'Plugin Development' started by Jamboozlez, Nov 10, 2013.

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

    Jamboozlez

    Hello,

    I found this when I went to get the colour 'Light red' from the 'Color' class (eg. Color.name). When I typed 'Color.' I could not see anything that symbolised Light Red. Confused as to what 'color' is really light red, I went to the Java Docs. What I found here added more confusion to what should have been a simple bit of code!

    Here I found names for colors, but some of them were different to what I can see in Eclipse (eg. Fuchsia does not appear in Eclipse, but is spoken of in the JavaDocs).

    So, my question is, what do I type for Light Red in Eclipse (usually &c in-game)? Is there a list of colours and there relative names in Eclipse? And as an extra question that doesn't really need an answer, why does everything say different things for colour?

    Notes:

    I am using CraftBukkit 1.6.4 R2.0 for the Bukkit API in Eclipse. JavaDocs is apparently the same version.

    JavaDocs Link: http://jd.bukkit.org/rb/doxygen/d8/d67/classorg_1_1bukkit_1_1Color.html


    Thanks in advance!
     
  2. Offline

    Xacero

    I think it might be ChatColor.RED and ChatColor.DARK_RED as light and dark respectively, but not 100% sure and don't have a dev environment handy to check sorry. Hope it helps. :)
     
    Jamboozlez likes this.
  3. Offline

    elementalgodz11

    Light_Red is just red
    Color.RED
     
    Jamboozlez likes this.
  4. Offline

    Jamboozlez

    Oh, I think I've made a mistake - now you've said 'ChatColor' it's jogged my memory. I think I should be using ChatColor instead of Color anyway.

    I can't see a Color.DarkRed etc. in Eclipse :( (EDIT: There is a ChatColor.Dark_Red though :))

    Thanks for both of the replies, I'll test them now :)
     
  5. Offline

    br456

    List of colors

    An example sending colored message:

    Code:java
    1. public void sendHelpMessage(Player player) {
    2. player.sendMessage(ChatColor.RED + "Invalid command!")
    3.  
    4. }
     
  6. Offline

    Ultimate_n00b

  7. Offline

    Jamboozlez

    I realise now that I made a mistake between using 'Color' and 'ChatColor'. Marked as solved :)
     
Thread Status:
Not open for further replies.

Share This Page