User Tools

Site Tools


thinkgeo_cloud_colors

This is an old revision of the document!


ThinkGeo Cloud Colors

ThinkGeo Cloud Colors provides some ways to generate families of colors based on the input color. 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

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

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

A .Net SDK ThinkGeo Cloud Client is provided to consume the ThinkGeo Cloud Service as well. It's available on NuGet, here is the complete API List.

Sample Code:

ColorClient client = new ColorClient("clientId", "clientSecret");
 
Dictionary<GeoColor, Collection<GeoColor>> results = client.GetColorsInAnalogousFamily(new GeoColor(255, 0, 255), 5);
Task<Dictionary<GeoColor, Collection<GeoColor>>> results = client.GetColorsInAnalogousFamily(new GeoColor(255, 0, 255), 5);
 
Dictionary<GeoColor, Collection<GeoColor>> results = client.GetColorsInAnalogousFamily(5);
Task<Dictionary<GeoColor, Collection<GeoColor>>> results = client.GetColorsInAnalogousFamily(5);

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

Samples

thinkgeo_cloud_colors.1552023086.txt.gz · Last modified: 2019/03/08 05:31 by tgwikiupdate