User Tools

Site Tools


thinkgeo_cloud_colors

This is an old revision of the document!


ThinkGeo Cloud Colors

ThinkGeo Cloud Colors provides several ways to generate harmonious themes of colors, which you can use to design attractive and meaningful maps. Your color themes can be designed around a specific base color, or the service can choose a random color for you. Check out Generate Color Themes for a quick look.

RESTful APIs

Try it Online

There are two kinds of APIs provided by ThinkGeo Cloud Colors Utility that provide different color generation algorithms.

Generate Colors Based On A Specific Color

HTTP GET 
https://cloud.thinkgeo.com/api/v1/color/scheme/{algorithm}/{inputColor}/{numberOfColors}?inFormat={inFormat}&outFormat={outFormat}&apiKey={apiKey}

URL Parameters

  • algorithm: The algorithm, supported values are:
    • analogous: Get a family of colors based on three analogous hues.
    • complementary: Get a family of colors based on two complementary hues.
    • contrasting: Get a family of colors based on two contrasting hues.
    • sequential: Get a family of colors with the same hue and sequential variances in lightness and saturation.
    • qualitative: Get a family of colors with qualitative variances in hue, but similar lightness and saturation.
    • tetrad: Get a family of colors based on a harmonious tetrad of hues.
    • triad: Get a family of colors based on a harmonious triad of hues.
  • inputColor: A base color, for different algorithms:
    • analogous: Two analogous hues will be found for you.
    • complementary: A complementary hue will be found for you.
    • contrasting: A contrasting hue will be found for you.
    • sequential: It's the color on which you want to base the color collection.
    • qualitative: It's the color on which you want to base the color collection.
    • tetrad: Three harmonious hues will be found for you.
    • triad: It's the color on which you want to base the colors collections.
  • numberOfColors: The total number of colors you want to be returned, for different algorithms:
    • analogous: The value must be between 3 and 54.
    • complementary: The value must be between 2 and 36.
    • contrasting: The value must be between 2 and 36.
    • sequential: The value must be between 1 and 255.
    • qualitative: The value must be between 1 and 255.
    • tetrad: The value must be between 4 and 72.
    • triad: The value must be between 3 and 54.
  • apikey: the apikey
  • inFormat (optional): The format of the inputColor. Supported formats: Hex, RGB, HSL. If unspecified, the server will try to parse the inputColor in the order of Hex, RGB and HSL.
  • outFormat (optional): The format in which you want the output colors. Supported formats: Hex, RGB, HSL. Defaults to Hex.

Sample Request https://cloud.thinkgeo.com/api/v1/color/scheme/analogous/FF00FF/5?apiKey=mykey

Generate Colors Based On A Random Color

HTTP GET 
https://cloud.thinkgeo.com/api/v1/color/scheme/{algorithm}/random/{numberOfColors}?outFormat={outFormat}&apiKey={apiKey}

URL Parameters

  • algorithm: The algorithm, supported values are:
    • analogous: Get a family of colors based on three analogous hues.
    • complementary: Get a family of colors based on two complementary hues.
    • contrasting: Get a family of colors based on two contrasting hues.
    • sequential: Get a family of colors with the same hue and sequential variances in lightness and saturation.
    • qualitative: Get a family of colors with qualitative variances in hue, but similar lightness and saturation.
    • tetrad: Get a family of colors based on a harmonious tetrad of hues.
    • triad: Get a family of colors based on a harmonious triad of hues.
  • numberOfColors: The total number of colors you want to be returned, for different algorithm:
    • analogous: The value must be between 3 and 54.
    • complementary: The value must be between 2 and 36.
    • contrasting: The value must be between 2 and 36.
    • sequential: The value must be between 1 and 255.
    • qualitative: The value must be between 1 and 255.
    • tetrad: The value must be between 4 and 72.
    • triad: The value must be between 3 and 54.
  • apikey: the apikey
  • outFormat (optional): The format in which you want the output colors. Supported formats: Hex, RGB, HSL. Defaults to Hex.

Sample Request https://cloud.thinkgeo.com/api/v1/color/scheme/analogous/random/5?apiKey=mykey

Consume From Client Side SDKs

Our .NET SDK ThinkGeo Cloud Client makes it easy to consume all of the ThinkGeo Cloud services in your applications. It's available on NuGet. IntelliSense hints will help you get started, and you can also refer to the ThinkGeo Cloud Client API list for details.

At the NuGet Package Manager terminal, you can install this package by running the command: Install-Package ThinkGeo.Cloud.Client -Version VERSION_TO_BE_INSTALLED.

Sample Code:

using ThinkGeo.Cloud;
using ThinkGeo.MapSuite.Drawing;
 
ColorClient client = new ColorClient("Your Client ID", "Your Client Secret");
Dictionary<GeoColor, Collection<GeoColor>> results = client.GetColorsInAnalogousFamily(new GeoColor(255, 0, 255), 5);
Dictionary<GeoColor, Collection<GeoColor>> results = client.GetColorsInAnalogousFamily(5);

Native SDKs for Python, iOS and Android are coming soon.

Samples

Online Sample:

Desktop Sample:

Web Sample:

Coming soon

Mobile Sample:

Coming soon
thinkgeo_cloud_colors.1552331950.txt.gz · Last modified: 2019/03/11 19:19 by brianr