Stop color change
What's this?
This is an REST API to get a requested color, its complementary and its grayscale in different formats and the black or white text corresponding to each color according to its brightness.
Color formats
Keyword
HEX
RGB / RGBA
HSL / HSLA
Request
You can use Keyword, HEX(3,4,6 or 8 characters), RGB or RGBA and HSL or HSLA formats to send your color.
Returned colors
Base (requested)
Base (requested) without alpha
Contrasted text
Complementary
Complementary without alpha
Contrasted text
Grayscale
Grayscale without alpha
Contrasted text
Returned colors in JSON
                
                    {
                        "base": {...},
                        "base_without_alpha": {...},
                        "base_without_alpha_contrasted_text": {...},
                        "complementary": {...},
                        "complementary_without_alpha": {...},
                        "complementary_without_alpha_contrasted_text": {...},
                        "grayscale": {...},
                        "grayscale_without_alpha": {...},
                        "grayscale_without_alpha_contrasted_text": {...}
                    }
                
            
Data for each color in JSON
                
                    {
                        "keyword": "aquamarine",
                        "hex": {
                            "value": "#7fffd4",
                            "composition": {
                            "red": "7f",
                            "green": "ff",
                            "blue": "d4"
                            }
                        },
                        "rgb": {
                            "value": "rgb(127, 255, 212)",
                            "composition": {
                            "red": 127,
                            "green": 255,
                            "blue": 212
                            }
                        },
                        "hsl": {
                            "value": "hsl(160, 100%, 75%)",
                            "composition": {
                            "hue": 160,
                            "saturation": 100,
                            "lightness": 75
                            }
                        },
                        "hsl_raw": {
                            "value": "hsl(159.84375, 100%, 74.90196%)",
                            "composition": {
                            "hue": 159.84375,
                            "saturation": 100,
                            "lightness": 74.90196
                            }
                        }
                    }
                
            
Example error API response
                
                {
                    "status": "error",
                    "error": {
                        "type": "wrong color format",
                        "value": "yellou",
                        "message": "not a valid KEYWORD color"
                    }
                }
                
            
Example success API response
                
                {
    "status": "success",
    "base": {
        "keyword": "",
        "hex": {
            "value": "#5c6ba046",
            "composition": {
                "red": "5c",
                "green": "6b",
                "blue": "a0",
                "alpha": "46"
            }
        },
        "rgba": {
            "value": "rgba(92, 107, 160, 0.27)",
            "composition": {
                "red": 92,
                "green": 107,
                "blue": 160,
                "alpha": 0.27451
            }
        },
        "hsla": {
            "value": "hsla(227, 27%, 49%, 0.27)",
            "composition": {
                "hue": 227,
                "saturation": 27,
                "lightness": 49,
                "alpha": 0.27451
            }
        },
        "hsla_raw": {
            "value": "hsla(226.76471, 26.98413%, 49.41176%, 0.27)",
            "composition": {
                "hue": 226.76471,
                "saturation": 26.98413,
                "lightness": 49.41176,
                "alpha": 0.27451
            }
        }
    },
    "base_without_alpha": {
        "keyword": "",
        "hex": {
            "value": "#5c6ba0",
            "composition": {
                "red": "5c",
                "green": "6b",
                "blue": "a0"
            }
        },
        "rgb": {
            "value": "rgb(92, 107, 160)",
            "composition": {
                "red": 92,
                "green": 107,
                "blue": 160
            }
        },
        "hsl": {
            "value": "hsl(227, 27%, 49%)",
            "composition": {
                "hue": 227,
                "saturation": 27,
                "lightness": 49
            }
        },
        "hsl_raw": {
            "value": "hsl(226.76471, 26.98413%, 49.41176%)",
            "composition": {
                "hue": 226.76471,
                "saturation": 26.98413,
                "lightness": 49.41176
            }
        }
    },
    "base_without_alpha_contrasted_text": {
        "keyword": "white",
        "hex": {
            "value": "#ffffff",
            "composition": {
                "red": "ff",
                "green": "ff",
                "blue": "ff"
            }
        },
        "rgb": {
            "value": "rgb(255, 255, 255)",
            "composition": {
                "red": 255,
                "green": 255,
                "blue": 255
            }
        },
        "hsl": {
            "value": "hsl(0, 0%, 100%)",
            "composition": {
                "hue": 0,
                "saturation": 0,
                "lightness": 100
            }
        },
        "hsl_raw": {
            "value": "hsl(0, 0%, 100%)",
            "composition": {
                "hue": 0,
                "saturation": 0,
                "lightness": 100
            }
        }
    },
    "complementary": {
        "keyword": "",
        "hex": {
            "value": "#a3945f46",
            "composition": {
                "red": "a3",
                "green": "94",
                "blue": "5f",
                "alpha": "46"
            }
        },
        "rgba": {
            "value": "rgba(163, 148, 95, 0.27)",
            "composition": {
                "red": 163,
                "green": 148,
                "blue": 95,
                "alpha": 0.27451
            }
        },
        "hsla": {
            "value": "hsla(47, 27%, 51%, 0.27)",
            "composition": {
                "hue": 47,
                "saturation": 27,
                "lightness": 51,
                "alpha": 0.27451
            }
        },
        "hsla_raw": {
            "value": "hsla(46.76471, 26.98413%, 50.58824%, 0.27)",
            "composition": {
                "hue": 46.76471,
                "saturation": 26.98413,
                "lightness": 50.58824,
                "alpha": 0.27451
            }
        }
    },
    "complementary_without_alpha": {
        "keyword": "",
        "hex": {
            "value": "#a3945f",
            "composition": {
                "red": "a3",
                "green": "94",
                "blue": "5f"
            }
        },
        "rgb": {
            "value": "rgb(163, 148, 95)",
            "composition": {
                "red": 163,
                "green": 148,
                "blue": 95
            }
        },
        "hsl": {
            "value": "hsl(47, 27%, 51%)",
            "composition": {
                "hue": 47,
                "saturation": 27,
                "lightness": 51
            }
        },
        "hsl_raw": {
            "value": "hsl(46.76471, 26.98413%, 50.58824%)",
            "composition": {
                "hue": 46.76471,
                "saturation": 26.98413,
                "lightness": 50.58824
            }
        }
    },
    "complementary_without_alpha_contrasted_text": {
        "keyword": "black",
        "hex": {
            "value": "#000000",
            "composition": {
                "red": "00",
                "green": "00",
                "blue": "00"
            }
        },
        "rgb": {
            "value": "rgb(0, 0, 0)",
            "composition": {
                "red": 0,
                "green": 0,
                "blue": 0
            }
        },
        "hsl": {
            "value": "hsl(0, 0%, 0%)",
            "composition": {
                "hue": 0,
                "saturation": 0,
                "lightness": 0
            }
        },
        "hsl_raw": {
            "value": "hsl(0, 0%, 0%)",
            "composition": {
                "hue": 0,
                "saturation": 0,
                "lightness": 0
            }
        }
    },
    "grayscale": {
        "keyword": "",
        "hex": {
            "value": "#7e7e7e46",
            "composition": {
                "red": "7e",
                "green": "7e",
                "blue": "7e",
                "alpha": "46"
            }
        },
        "rgba": {
            "value": "rgba(126, 126, 126, 0.27)",
            "composition": {
                "red": 126,
                "green": 126,
                "blue": 126,
                "alpha": 0.27451
            }
        },
        "hsla": {
            "value": "hsla(227, 0%, 49%, 0.27)",
            "composition": {
                "hue": 227,
                "saturation": 0,
                "lightness": 49,
                "alpha": 0.27451
            }
        },
        "hsla_raw": {
            "value": "hsla(226.76471, 0%, 49.41176%, 0.27)",
            "composition": {
                "hue": 226.76471,
                "saturation": 0,
                "lightness": 49.41176,
                "alpha": 0.27451
            }
        }
    },
    "grayscale_without_alpha": {
        "keyword": "",
        "hex": {
            "value": "#7e7e7e",
            "composition": {
                "red": "7e",
                "green": "7e",
                "blue": "7e"
            }
        },
        "rgb": {
            "value": "rgb(126, 126, 126)",
            "composition": {
                "red": 126,
                "green": 126,
                "blue": 126
            }
        },
        "hsl": {
            "value": "hsl(227, 0%, 49%)",
            "composition": {
                "hue": 227,
                "saturation": 0,
                "lightness": 49
            }
        },
        "hsl_raw": {
            "value": "hsl(226.76471, 0%, 49.41176%)",
            "composition": {
                "hue": 226.76471,
                "saturation": 0,
                "lightness": 49.41176
            }
        }
    },
    "grayscale_without_alpha_contrasted_text": {
        "keyword": "white",
        "hex": {
            "value": "#ffffff",
            "composition": {
                "red": "ff",
                "green": "ff",
                "blue": "ff"
            }
        },
        "rgb": {
            "value": "rgb(255, 255, 255)",
            "composition": {
                "red": 255,
                "green": 255,
                "blue": 255
            }
        },
        "hsl": {
            "value": "hsl(0, 0%, 100%)",
            "composition": {
                "hue": 0,
                "saturation": 0,
                "lightness": 100
            }
        },
        "hsl_raw": {
            "value": "hsl(0, 0%, 100%)",
            "composition": {
                "hue": 0,
                "saturation": 0,
                "lightness": 100
            }
        }
    }
}