Managing color tags through config files

Jul 12, 2020
Managing color tags through config files
  • Managing color tags through config files
    There is two ways which you can manage color tags with Iridescent: using commands, or directly in the colors.yml file. For beginners I suggest to manage them using commands, as the risk of crashing the plugin is minimal. Managing the color tags in the colors.yml file can be faster, however a typo anywhere can lead to many complications.

    By default, Iridescent comes with 25 custom colors which are ready to use by the user or any plugin present on the server. You can use these as a guideline to create new colors alongside the existing ones.

    Handling tags in the colors.yml

    Creating color tags in the colors.yml is not as straight forward as it is with commands but similarly, after having done it a few times it becomes easy to do it again. There is plenty of things that should be kept in mind when writing onto the colors file.
    Let's look at the first three colors that are present in the colors.yml upon plugin installation.


    Code (YAML):

    Color Tags
    :
      ff0000
    : "fire"
      dc143c
    : "crimson"
      b45019
    : "rust"
    Color tag definition is divided in two parts: The first one where you define the color's hex value, and the second one where you define the color tag's name.

    Hex color code: When defining a hex color code, it's important to remember that the '#' that is usually found in front of
    hex color codes needs to be omitted. So hex color code "#ff00ff" should be written as ff00ff instead.
    Color tag: The color tag has to follow some strict guidelines to avoid issues.
    - 1. The tag name must be between 1 and 16 characters long
    - 2. The tag name must be alphanumeric, and can contain (_) underscores.
    - 3. The tag name must not have any duplicates

    Each color needs to be aligned perfectly like shown in the example above. It's important that all colors are perfectly aligned to avoid issues.

    To delete a tag, simply delete the line it is created in. It is suggested to always have at least one color tag, to avoid possible complications.

    Using these colors in-game

    Once you have created a color tag, it's important that you run the command /iridescent reload in order for the available colors to update.
  • Loading...
  • Loading...