API:2/colors

From Guild Wars 2 Wiki
Jump to navigationJump to search

/v2/colors

HTTP method
GET
Format
json
API version
version 2
Release date
2015-02-13
Scope
none
Optional
none

This resource returns all dye colors in the game, including localized names and their color component information.

Parameters

Optional parameters
  • lang – The language to query the names for.

Response

If the root endpoint (/v2/colors) is accessed without specifying an id, a list of all ids is returned. When multiple ids are requested using the ids parameter, a list of response objects is returned.

For each requested color id, an object with the following properties is returned:

  • id - The color id.
  • name (string) – The color name.
  • base_rgb (array of numbers) – The base RGB values.
  • cloth (object) – Detailed information on its appearance when applied on cloth armor.
  • leather (object) – Detailed information on its appearance when applied on leather armor.
  • metal (object) – Detailed information on its appearance when applied on metal armor.
  • fur (object, optional) – Detailed information on its appearance when applied on fur armor.
  • item (number, optional) - ID of the dye item.
  • categories (list of strings) - Color categories. Possible values:
    • Hue: Gray, Brown, Red, Orange, Yellow, Green, Blue, Purple
    • Material: Vibrant, Leather, Metal
    • Rarity: Starter, Common, Uncommon, Rare, Exclusive


The detailed information object contains the following properties:

  • brightness (number) – The brightness.
  • contrast (number) – The contrast.
  • hue (number) – The hue in the HSL colorspace.
  • saturation (number) – The saturation in the HSL colorspace.
  • lightness (number) – The lightness in the HSL colorspace.
  • rgb (list) – A list containing precalculated RGB values.

Example

https://api.guildwars2.com/v2/colors/10

{
  "id": 10,
  "name": "Sky",
  "base_rgb": [
    128,
    26,
    26
  ],
  "cloth": {
    "brightness": 22,
    "contrast": 1.25,
    "hue": 196,
    "saturation": 0.742188,
    "lightness": 1.32813,
    "rgb": [
      54,
      130,
      160
    ]
  },
  "leather": {
    "brightness": 22,
    "contrast": 1.25,
    "hue": 196,
    "saturation": 0.664063,
    "lightness": 1.32813,
    "rgb": [
      61,
      129,
      156
    ]
  },
  "metal": {
    "brightness": 22,
    "contrast": 1.28906,
    "hue": 196,
    "saturation": 0.546875,
    "lightness": 1.32813,
    "rgb": [
      65,
      123,
      146
    ]
  },
  "fur": {
    "brightness": 22,
    "contrast": 1.25,
    "hue": 196,
    "saturation": 0.742188,
    "lightness": 1.32813,
    "rgb": [
      54,
      130,
      160
    ]
  },
  "item": 20370,
  "categories": [
    "Blue",
    "Vibrant",
    "Rare"
  ]
}

Notes

Every color except Hydra (1594) has a fur field. (ref)