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": "#7a59e9fc",
            "composition": {
                "red": "7a",
                "green": "59",
                "blue": "e9",
                "alpha": "fc"
            }
        },
        "rgba": {
            "value": "rgba(122, 89, 233, 0.99)",
            "composition": {
                "red": 122,
                "green": 89,
                "blue": 233,
                "alpha": 0.98824
            }
        },
        "hsla": {
            "value": "hsla(254, 77%, 63%, 0.99)",
            "composition": {
                "hue": 254,
                "saturation": 77,
                "lightness": 63,
                "alpha": 0.98824
            }
        },
        "hsla_raw": {
            "value": "hsla(253.75, 76.59574%, 63.13725%, 0.99)",
            "composition": {
                "hue": 253.75,
                "saturation": 76.59574,
                "lightness": 63.13725,
                "alpha": 0.98824
            }
        }
    },
    "base_without_alpha": {
        "keyword": "",
        "hex": {
            "value": "#7a59e9",
            "composition": {
                "red": "7a",
                "green": "59",
                "blue": "e9"
            }
        },
        "rgb": {
            "value": "rgb(122, 89, 233)",
            "composition": {
                "red": 122,
                "green": 89,
                "blue": 233
            }
        },
        "hsl": {
            "value": "hsl(254, 77%, 63%)",
            "composition": {
                "hue": 254,
                "saturation": 77,
                "lightness": 63
            }
        },
        "hsl_raw": {
            "value": "hsl(253.75, 76.59574%, 63.13725%)",
            "composition": {
                "hue": 253.75,
                "saturation": 76.59574,
                "lightness": 63.13725
            }
        }
    },
    "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": "#85a616fc",
            "composition": {
                "red": "85",
                "green": "a6",
                "blue": "16",
                "alpha": "fc"
            }
        },
        "rgba": {
            "value": "rgba(133, 166, 22, 0.99)",
            "composition": {
                "red": 133,
                "green": 166,
                "blue": 22,
                "alpha": 0.98824
            }
        },
        "hsla": {
            "value": "hsla(74, 77%, 37%, 0.99)",
            "composition": {
                "hue": 74,
                "saturation": 77,
                "lightness": 37,
                "alpha": 0.98824
            }
        },
        "hsla_raw": {
            "value": "hsla(73.75, 76.59574%, 36.86275%, 0.99)",
            "composition": {
                "hue": 73.75,
                "saturation": 76.59574,
                "lightness": 36.86275,
                "alpha": 0.98824
            }
        }
    },
    "complementary_without_alpha": {
        "keyword": "",
        "hex": {
            "value": "#85a616",
            "composition": {
                "red": "85",
                "green": "a6",
                "blue": "16"
            }
        },
        "rgb": {
            "value": "rgb(133, 166, 22)",
            "composition": {
                "red": 133,
                "green": 166,
                "blue": 22
            }
        },
        "hsl": {
            "value": "hsl(74, 77%, 37%)",
            "composition": {
                "hue": 74,
                "saturation": 77,
                "lightness": 37
            }
        },
        "hsl_raw": {
            "value": "hsl(73.75, 76.59574%, 36.86275%)",
            "composition": {
                "hue": 73.75,
                "saturation": 76.59574,
                "lightness": 36.86275
            }
        }
    },
    "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": "#a1a1a1fc",
            "composition": {
                "red": "a1",
                "green": "a1",
                "blue": "a1",
                "alpha": "fc"
            }
        },
        "rgba": {
            "value": "rgba(161, 161, 161, 0.99)",
            "composition": {
                "red": 161,
                "green": 161,
                "blue": 161,
                "alpha": 0.98824
            }
        },
        "hsla": {
            "value": "hsla(254, 0%, 63%, 0.99)",
            "composition": {
                "hue": 254,
                "saturation": 0,
                "lightness": 63,
                "alpha": 0.98824
            }
        },
        "hsla_raw": {
            "value": "hsla(253.75, 0%, 63.13725%, 0.99)",
            "composition": {
                "hue": 253.75,
                "saturation": 0,
                "lightness": 63.13725,
                "alpha": 0.98824
            }
        }
    },
    "grayscale_without_alpha": {
        "keyword": "",
        "hex": {
            "value": "#a1a1a1",
            "composition": {
                "red": "a1",
                "green": "a1",
                "blue": "a1"
            }
        },
        "rgb": {
            "value": "rgb(161, 161, 161)",
            "composition": {
                "red": 161,
                "green": 161,
                "blue": 161
            }
        },
        "hsl": {
            "value": "hsl(254, 0%, 63%)",
            "composition": {
                "hue": 254,
                "saturation": 0,
                "lightness": 63
            }
        },
        "hsl_raw": {
            "value": "hsl(253.75, 0%, 63.13725%)",
            "composition": {
                "hue": 253.75,
                "saturation": 0,
                "lightness": 63.13725
            }
        }
    },
    "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
            }
        }
    }
}