Color Name API

Default

listsGet

Get all colors of the default color name list

Returns a list of available color name lists with descriptions and URLs to the color list endpoints.


/lists/

Usage and SDK Samples

curl -X GET \
 -H "Accept: application/json" \
 "https://api.color.pizza/v1/lists/"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.DefaultApi;

import java.io.File;
import java.util.*;

public class DefaultApiExample {
    public static void main(String[] args) {

        // Create an instance of the API class
        DefaultApi apiInstance = new DefaultApi();

        try {
            _lists__get_200_response result = apiInstance.listsGet();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#listsGet");
            e.printStackTrace();
        }
    }
}
import org.openapitools.client.api.DefaultApi;

public class DefaultApiExample {
    public static void main(String[] args) {
        DefaultApi apiInstance = new DefaultApi();

        try {
            _lists__get_200_response result = apiInstance.listsGet();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#listsGet");
            e.printStackTrace();
        }
    }
}


// Create an instance of the API class
DefaultApi *apiInstance = [[DefaultApi alloc] init];

// Get all colors of the default color name list
[apiInstance listsGetWithCompletionHandler: 
              ^(_lists__get_200_response output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var ColorNameApi = require('color_name_api');

// Create an instance of the API class
var api = new ColorNameApi.DefaultApi()
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.listsGet(callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class listsGetExample
    {
        public void main()
        {

            // Create an instance of the API class
            var apiInstance = new DefaultApi();

            try {
                // Get all colors of the default color name list
                _lists__get_200_response result = apiInstance.listsGet();
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling DefaultApi.listsGet: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\DefaultApi();

try {
    $result = $api_instance->listsGet();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DefaultApi->listsGet: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::DefaultApi;

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::DefaultApi->new();

eval {
    my $result = $api_instance->listsGet();
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling DefaultApi->listsGet: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Create an instance of the API class
api_instance = openapi_client.DefaultApi()

try:
    # Get all colors of the default color name list
    api_response = api_instance.lists_get()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DefaultApi->listsGet: %s\n" % e)
extern crate DefaultApi;

pub fn main() {

    let mut context = DefaultApi::Context::default();
    let result = client.listsGet(&context).wait();

    println!("{:?}", result);
}

Scopes

Parameters

Responses


namesGet

Get all colors of the default color name list


/names/

Usage and SDK Samples

curl -X GET \
 -H "Accept: application/json" \
 "https://api.color.pizza/v1/names/?name=name_example&list="
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.DefaultApi;

import java.io.File;
import java.util.*;

public class DefaultApiExample {
    public static void main(String[] args) {

        // Create an instance of the API class
        DefaultApi apiInstance = new DefaultApi();
        String name = name_example; // String | The name of the color to retrieve (min 3 characters)
        PossibleLists list = ; // PossibleLists | The name of the color name list to use

        try {
            _names__get_200_response result = apiInstance.namesGet(name, list);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#namesGet");
            e.printStackTrace();
        }
    }
}
import org.openapitools.client.api.DefaultApi;

public class DefaultApiExample {
    public static void main(String[] args) {
        DefaultApi apiInstance = new DefaultApi();
        String name = name_example; // String | The name of the color to retrieve (min 3 characters)
        PossibleLists list = ; // PossibleLists | The name of the color name list to use

        try {
            _names__get_200_response result = apiInstance.namesGet(name, list);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#namesGet");
            e.printStackTrace();
        }
    }
}


// Create an instance of the API class
DefaultApi *apiInstance = [[DefaultApi alloc] init];
String *name = name_example; // The name of the color to retrieve (min 3 characters) (default to null)
PossibleLists *list = ; // The name of the color name list to use (optional) (default to null)

// Get all colors of the default color name list
[apiInstance namesGetWith:name
    list:list
              completionHandler: ^(_names__get_200_response output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var ColorNameApi = require('color_name_api');

// Create an instance of the API class
var api = new ColorNameApi.DefaultApi()
var name = name_example; // {String} The name of the color to retrieve (min 3 characters)
var opts = {
  'list':  // {PossibleLists} The name of the color name list to use
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.namesGet(name, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class namesGetExample
    {
        public void main()
        {

            // Create an instance of the API class
            var apiInstance = new DefaultApi();
            var name = name_example;  // String | The name of the color to retrieve (min 3 characters) (default to null)
            var list = new PossibleLists(); // PossibleLists | The name of the color name list to use (optional)  (default to null)

            try {
                // Get all colors of the default color name list
                _names__get_200_response result = apiInstance.namesGet(name, list);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling DefaultApi.namesGet: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\DefaultApi();
$name = name_example; // String | The name of the color to retrieve (min 3 characters)
$list = ; // PossibleLists | The name of the color name list to use

try {
    $result = $api_instance->namesGet($name, $list);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DefaultApi->namesGet: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::DefaultApi;

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::DefaultApi->new();
my $name = name_example; # String | The name of the color to retrieve (min 3 characters)
my $list = ; # PossibleLists | The name of the color name list to use

eval {
    my $result = $api_instance->namesGet(name => $name, list => $list);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling DefaultApi->namesGet: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Create an instance of the API class
api_instance = openapi_client.DefaultApi()
name = name_example # String | The name of the color to retrieve (min 3 characters) (default to null)
list =  # PossibleLists | The name of the color name list to use (optional) (default to null)

try:
    # Get all colors of the default color name list
    api_response = api_instance.names_get(name, list=list)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DefaultApi->namesGet: %s\n" % e)
extern crate DefaultApi;

pub fn main() {
    let name = name_example; // String
    let list = ; // PossibleLists

    let mut context = DefaultApi::Context::default();
    let result = client.namesGet(name, list, &context).wait();

    println!("{:?}", result);
}

Scopes

Parameters

Query parameters
Name Description
name*
String
The name of the color to retrieve (min 3 characters)
Required
list
PossibleLists
The name of the color name list to use

Responses


rootGet

Get all colors of the default color name list

Returns an array of colors from the specified list, with distance calculations to show how close each match is to the requested colors. When providing multiple values, the endpoint will find the closest match for each color.


/

Usage and SDK Samples

curl -X GET \
 -H "Accept: application/json" \
 "https://api.color.pizza/v1/?list=&values=values_example&noduplicates=true"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.DefaultApi;

import java.io.File;
import java.util.*;

public class DefaultApiExample {
    public static void main(String[] args) {

        // Create an instance of the API class
        DefaultApi apiInstance = new DefaultApi();
        PossibleLists list = ; // PossibleLists | The name of the color name list to use (case-insensitive)
        String values = values_example; // String | A comma-separated list of hex values (e.g., `FF0000,00FF00` do not include the `#`)
        Boolean noduplicates = true; // Boolean | Allow duplicate names or not

        try {
            __get_200_response result = apiInstance.rootGet(list, values, noduplicates);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#rootGet");
            e.printStackTrace();
        }
    }
}
import org.openapitools.client.api.DefaultApi;

public class DefaultApiExample {
    public static void main(String[] args) {
        DefaultApi apiInstance = new DefaultApi();
        PossibleLists list = ; // PossibleLists | The name of the color name list to use (case-insensitive)
        String values = values_example; // String | A comma-separated list of hex values (e.g., `FF0000,00FF00` do not include the `#`)
        Boolean noduplicates = true; // Boolean | Allow duplicate names or not

        try {
            __get_200_response result = apiInstance.rootGet(list, values, noduplicates);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#rootGet");
            e.printStackTrace();
        }
    }
}


// Create an instance of the API class
DefaultApi *apiInstance = [[DefaultApi alloc] init];
PossibleLists *list = ; // The name of the color name list to use (case-insensitive) (optional) (default to null)
String *values = values_example; // A comma-separated list of hex values (e.g., `FF0000,00FF00` do not include the `#`) (optional) (default to null)
Boolean *noduplicates = true; // Allow duplicate names or not (optional) (default to null)

// Get all colors of the default color name list
[apiInstance rootGetWith:list
    values:values
    noduplicates:noduplicates
              completionHandler: ^(__get_200_response output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var ColorNameApi = require('color_name_api');

// Create an instance of the API class
var api = new ColorNameApi.DefaultApi()
var opts = {
  'list': , // {PossibleLists} The name of the color name list to use (case-insensitive)
  'values': values_example, // {String} A comma-separated list of hex values (e.g., `FF0000,00FF00` do not include the `#`)
  'noduplicates': true // {Boolean} Allow duplicate names or not
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.rootGet(opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class rootGetExample
    {
        public void main()
        {

            // Create an instance of the API class
            var apiInstance = new DefaultApi();
            var list = new PossibleLists(); // PossibleLists | The name of the color name list to use (case-insensitive) (optional)  (default to null)
            var values = values_example;  // String | A comma-separated list of hex values (e.g., `FF0000,00FF00` do not include the `#`) (optional)  (default to null)
            var noduplicates = true;  // Boolean | Allow duplicate names or not (optional)  (default to null)

            try {
                // Get all colors of the default color name list
                __get_200_response result = apiInstance.rootGet(list, values, noduplicates);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling DefaultApi.rootGet: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\DefaultApi();
$list = ; // PossibleLists | The name of the color name list to use (case-insensitive)
$values = values_example; // String | A comma-separated list of hex values (e.g., `FF0000,00FF00` do not include the `#`)
$noduplicates = true; // Boolean | Allow duplicate names or not

try {
    $result = $api_instance->rootGet($list, $values, $noduplicates);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DefaultApi->rootGet: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::DefaultApi;

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::DefaultApi->new();
my $list = ; # PossibleLists | The name of the color name list to use (case-insensitive)
my $values = values_example; # String | A comma-separated list of hex values (e.g., `FF0000,00FF00` do not include the `#`)
my $noduplicates = true; # Boolean | Allow duplicate names or not

eval {
    my $result = $api_instance->rootGet(list => $list, values => $values, noduplicates => $noduplicates);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling DefaultApi->rootGet: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Create an instance of the API class
api_instance = openapi_client.DefaultApi()
list =  # PossibleLists | The name of the color name list to use (case-insensitive) (optional) (default to null)
values = values_example # String | A comma-separated list of hex values (e.g., `FF0000,00FF00` do not include the `#`) (optional) (default to null)
noduplicates = true # Boolean | Allow duplicate names or not (optional) (default to null)

try:
    # Get all colors of the default color name list
    api_response = api_instance.root_get(list=list, values=values, noduplicates=noduplicates)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DefaultApi->rootGet: %s\n" % e)
extern crate DefaultApi;

pub fn main() {
    let list = ; // PossibleLists
    let values = values_example; // String
    let noduplicates = true; // Boolean

    let mut context = DefaultApi::Context::default();
    let result = client.rootGet(list, values, noduplicates, &context).wait();

    println!("{:?}", result);
}

Scopes

Parameters

Query parameters
Name Description
list
PossibleLists
The name of the color name list to use (case-insensitive)
values
String
A comma-separated list of hex values (e.g., `FF0000,00FF00` do not include the `#`)
noduplicates
Boolean
Allow duplicate names or not

Responses


swatchGet

Generate a color swatch for any color

Generates an SVG swatch representation of a color. The swatch can include the color name if provided. The SVG is designed to be visually appealing and readable across different backgrounds.


/swatch/

Usage and SDK Samples

curl -X GET \
 -H "Accept: image/svg+xml,application/json" \
 "https://api.color.pizza/v1/swatch/?color=color_example&name=name_example"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.DefaultApi;

import java.io.File;
import java.util.*;

public class DefaultApiExample {
    public static void main(String[] args) {

        // Create an instance of the API class
        DefaultApi apiInstance = new DefaultApi();
        String color = color_example; // String | The hex value of the color to retrieve without '#'
        String name = name_example; // String | The name of the color

        try {
            'String' result = apiInstance.swatchGet(color, name);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#swatchGet");
            e.printStackTrace();
        }
    }
}
import org.openapitools.client.api.DefaultApi;

public class DefaultApiExample {
    public static void main(String[] args) {
        DefaultApi apiInstance = new DefaultApi();
        String color = color_example; // String | The hex value of the color to retrieve without '#'
        String name = name_example; // String | The name of the color

        try {
            'String' result = apiInstance.swatchGet(color, name);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#swatchGet");
            e.printStackTrace();
        }
    }
}


// Create an instance of the API class
DefaultApi *apiInstance = [[DefaultApi alloc] init];
String *color = color_example; // The hex value of the color to retrieve without '#' (default to null)
String *name = name_example; // The name of the color (optional) (default to null)

// Generate a color swatch for any color
[apiInstance swatchGetWith:color
    name:name
              completionHandler: ^('String' output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var ColorNameApi = require('color_name_api');

// Create an instance of the API class
var api = new ColorNameApi.DefaultApi()
var color = color_example; // {String} The hex value of the color to retrieve without '#'
var opts = {
  'name': name_example // {String} The name of the color
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.swatchGet(color, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class swatchGetExample
    {
        public void main()
        {

            // Create an instance of the API class
            var apiInstance = new DefaultApi();
            var color = color_example;  // String | The hex value of the color to retrieve without '#' (default to null)
            var name = name_example;  // String | The name of the color (optional)  (default to null)

            try {
                // Generate a color swatch for any color
                'String' result = apiInstance.swatchGet(color, name);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling DefaultApi.swatchGet: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\DefaultApi();
$color = color_example; // String | The hex value of the color to retrieve without '#'
$name = name_example; // String | The name of the color

try {
    $result = $api_instance->swatchGet($color, $name);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DefaultApi->swatchGet: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::DefaultApi;

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::DefaultApi->new();
my $color = color_example; # String | The hex value of the color to retrieve without '#'
my $name = name_example; # String | The name of the color

eval {
    my $result = $api_instance->swatchGet(color => $color, name => $name);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling DefaultApi->swatchGet: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Create an instance of the API class
api_instance = openapi_client.DefaultApi()
color = color_example # String | The hex value of the color to retrieve without '#' (default to null)
name = name_example # String | The name of the color (optional) (default to null)

try:
    # Generate a color swatch for any color
    api_response = api_instance.swatch_get(color, name=name)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DefaultApi->swatchGet: %s\n" % e)
extern crate DefaultApi;

pub fn main() {
    let color = color_example; // String
    let name = name_example; // String

    let mut context = DefaultApi::Context::default();
    let result = client.swatchGet(color, name, &context).wait();

    println!("{:?}", result);
}

Scopes

Parameters

Query parameters
Name Description
color*
String
The hex value of the color to retrieve without '#'
Required
name
String
The name of the color

Responses