/// <summary> /// Returns an object with all provided color info. /// </summary> /// <returns></returns> public static Color Color(string hex = "random") { if (hex == "random") { hex = string.Format("{0:X6}", new Random().Next(0x1000000)); } JObject data = RequestFunctions.JObjectRequest($"color/{hex}"); var Color = new Color { BlackOrWhiteText = data["blackorwhite_text"].Value <string>(), Brightness = data["brightness"].Value <int>(), Hex = data["hex"].Value <string>(), ImageUrl = data["image"].Value <string>(), GradientImageUrl = data["image_gradient"].Value <string>(), Int = data["int"].Value <int>(), Name = data["name"].Value <string>(), RGB = data["rgb"].Value <string>(), RGBValue = new Color.RgbValue { R = data["rgb_values"]["r"].Value <int>(), G = data["rgb_values"]["g"].Value <int>(), B = data["rgb_values"]["b"].Value <int>() }, Shades = JsonConvert.DeserializeObject <string[]>(data["shade"].ToString()), Tints = JsonConvert.DeserializeObject <string[]>(data["tint"].ToString()), }; return(Color); }
/// <summary> /// Returns an object with all provided Steam profile info. /// </summary> /// <returns></returns> public static Steam Steam(string steamId) { JObject data = RequestFunctions.JObjectRequest($"steam/user/{steamId}"); var steam = new Steam { SteamId = new Steam.SteamID { SteamId3 = data["id"]["steamid3"].Value <string>(), SteamId32 = data["id"]["steamid32"].Value <string>(), SteamId64 = data["id"]["steamid64"].Value <string>(), CustomUrl = data["id"]["customurl"].Value <string>() }, Avatar = new Steam.SteamAvatar { AvatarSmall = data["avatars"]["avatar"].Value <string>(), AvatarMedium = data["avatars"]["avatarmedium"].Value <string>(), AvatarFull = data["avatars"]["avatarfull"].Value <string>(), }, Profile = new Steam.SteamProfile { Username = data["profile"]["username"].Value <string>(), Realname = data["profile"]["realname"].Value <string>() ?? null, Url = data["profile"]["url"].Value <string>(), Summary = data["profile"]["summary"].Value <string>(), Background = data["profile"]["background"].Value <string>(), Location = data["profile"]["location"].Value <string>(), Status = data["profile"]["state"].Value <string>(), Privacy = data["profile"]["privacy"].Value <string>(), TimeCreated = data["profile"]["timecreated"].Value <string>(), VACBanned = data["profile"]["vacbanned"].Value <bool>() } }; return(steam); }