A few questions about API usage
See the Content Terms of Use for what you can or can’t do (https://www.guildwars2.com/en/legal/guild-wars-2-content-terms-of-use/).
I don’t see anything in the terms that prohibits storing icons offline. Which would be silly because your browser already does that automatically when it caches those images, and we would all be in violation.
If you want to use the same colors that are used in-game then you’ll have to use a color sniffer tool. Run the game client in windowed mode for that.
After a quick google search: http://colorcop.net/
(edited by StevenL.3761)