public static async Task<User> ChangeAccountColours(this IUserSession session,
string profileBackgroundColor = "", string profileLinkColor = "", string profileSidebarBorderColor = "",
string profileSidebarFillColor = "", string profileTextColor = "")
{
var parameters = new TwitterParametersCollection();
parameters.Create(include_entities: true, skip_status: true);
if (!string.IsNullOrWhiteSpace(profileBackgroundColor))
{
parameters.Add("profile_background_color", profileBackgroundColor);
}
if (!string.IsNullOrWhiteSpace(profileLinkColor))
{
parameters.Add("profile_link_color", profileLinkColor);
}
if (!string.IsNullOrWhiteSpace(profileSidebarBorderColor))
{
parameters.Add("profile_sidebar_border_color", profileSidebarBorderColor);
}
if (!string.IsNullOrWhiteSpace(profileSidebarFillColor))
{
parameters.Add("profile_sidebar_fill_color", profileSidebarFillColor);
}
if (!string.IsNullOrWhiteSpace(profileTextColor))
{
parameters.Add("profile_text_color", profileTextColor);
}
return await session.PostAsync(TwitterApi.Resolve("/1.1/account/update_profile_colors.json"), parameters)
.ContinueWith(c => c.MapToSingle<User>());
}