Plan icon indicating copy to clipboard operation
Plan copied to clipboard

Parse luckperms prefix colors

Open AuroraLS3 opened this issue 3 years ago • 1 comments

Describe the issue

Luckperms prefix has some color syntax that is not parsed for display.

example

AuroraLS3 avatar May 21 '22 06:05 AuroraLS3

The primary formats that should matter for reference (rrggbb = for hex):

Legacy codes Minecraft Wiki

  • &c / §c

Adventure's rgb syntax Adventure docs

  • &#rrggbb (Unlikely to use §)

BungeeCord's Adventure docs

  • &x&r&r&g&g&b&b (also potentially with § instead)

MiniMessage Adventure/MM docs

  • <color name> eg. <red>
    • Color names from Minecraft wiki
      • With additional alises for dark_grey and grey (a -> e)
  • <#rrggbb>
  • <color:color name>
  • <color:#rrggbb>
  • Also <colour:***> with a extra u and <c:***>

Considering the complexity (especially of MiniMessage) it might be worth looking into doing using some of adventure's serializers to do the bulk of the heavy lifting, worth noting those serializer(s) should be relocated - but should not be relocated for sponge & velocity code since those use their platforms own serializers directly.

Also this also probably applies in a lot of places where Minecraft components are being used, not just LuckPerms prefixes. But in most other cases it should be easier to control/know in what format the input will be in.

Vankka avatar May 28 '22 13:05 Vankka