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": "#ea8e5f8b",
            "composition": {
                "red": "ea",
                "green": "8e",
                "blue": "5f",
                "alpha": "8b"
            }
        },
        "rgba": {
            "value": "rgba(234, 142, 95, 0.55)",
            "composition": {
                "red": 234,
                "green": 142,
                "blue": 95,
                "alpha": 0.5451
            }
        },
        "hsla": {
            "value": "hsla(20, 77%, 65%, 0.55)",
            "composition": {
                "hue": 20,
                "saturation": 77,
                "lightness": 65,
                "alpha": 0.5451
            }
        },
        "hsla_raw": {
            "value": "hsla(20.28777, 76.79558%, 64.5098%, 0.55)",
            "composition": {
                "hue": 20.28777,
                "saturation": 76.79558,
                "lightness": 64.5098,
                "alpha": 0.5451
            }
        }
    },
    "base_without_alpha": {
        "keyword": "",
        "hex": {
            "value": "#ea8e5f",
            "composition": {
                "red": "ea",
                "green": "8e",
                "blue": "5f"
            }
        },
        "rgb": {
            "value": "rgb(234, 142, 95)",
            "composition": {
                "red": 234,
                "green": 142,
                "blue": 95
            }
        },
        "hsl": {
            "value": "hsl(20, 77%, 65%)",
            "composition": {
                "hue": 20,
                "saturation": 77,
                "lightness": 65
            }
        },
        "hsl_raw": {
            "value": "hsl(20.28777, 76.79558%, 64.5098%)",
            "composition": {
                "hue": 20.28777,
                "saturation": 76.79558,
                "lightness": 64.5098
            }
        }
    },
    "base_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
            }
        }
    },
    "complementary": {
        "keyword": "",
        "hex": {
            "value": "#1571a08b",
            "composition": {
                "red": "15",
                "green": "71",
                "blue": "a0",
                "alpha": "8b"
            }
        },
        "rgba": {
            "value": "rgba(21, 113, 160, 0.55)",
            "composition": {
                "red": 21,
                "green": 113,
                "blue": 160,
                "alpha": 0.5451
            }
        },
        "hsla": {
            "value": "hsla(200, 77%, 35%, 0.55)",
            "composition": {
                "hue": 200,
                "saturation": 77,
                "lightness": 35,
                "alpha": 0.5451
            }
        },
        "hsla_raw": {
            "value": "hsla(200.28777, 76.79558%, 35.4902%, 0.55)",
            "composition": {
                "hue": 200.28777,
                "saturation": 76.79558,
                "lightness": 35.4902,
                "alpha": 0.5451
            }
        }
    },
    "complementary_without_alpha": {
        "keyword": "",
        "hex": {
            "value": "#1571a0",
            "composition": {
                "red": "15",
                "green": "71",
                "blue": "a0"
            }
        },
        "rgb": {
            "value": "rgb(21, 113, 160)",
            "composition": {
                "red": 21,
                "green": 113,
                "blue": 160
            }
        },
        "hsl": {
            "value": "hsl(200, 77%, 35%)",
            "composition": {
                "hue": 200,
                "saturation": 77,
                "lightness": 35
            }
        },
        "hsl_raw": {
            "value": "hsl(200.28777, 76.79558%, 35.4902%)",
            "composition": {
                "hue": 200.28777,
                "saturation": 76.79558,
                "lightness": 35.4902
            }
        }
    },
    "complementary_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
            }
        }
    },
    "grayscale": {
        "keyword": "",
        "hex": {
            "value": "#a4a4a48b",
            "composition": {
                "red": "a4",
                "green": "a4",
                "blue": "a4",
                "alpha": "8b"
            }
        },
        "rgba": {
            "value": "rgba(164, 164, 164, 0.55)",
            "composition": {
                "red": 164,
                "green": 164,
                "blue": 164,
                "alpha": 0.5451
            }
        },
        "hsla": {
            "value": "hsla(20, 0%, 65%, 0.55)",
            "composition": {
                "hue": 20,
                "saturation": 0,
                "lightness": 65,
                "alpha": 0.5451
            }
        },
        "hsla_raw": {
            "value": "hsla(20.28777, 0%, 64.5098%, 0.55)",
            "composition": {
                "hue": 20.28777,
                "saturation": 0,
                "lightness": 64.5098,
                "alpha": 0.5451
            }
        }
    },
    "grayscale_without_alpha": {
        "keyword": "",
        "hex": {
            "value": "#a4a4a4",
            "composition": {
                "red": "a4",
                "green": "a4",
                "blue": "a4"
            }
        },
        "rgb": {
            "value": "rgb(164, 164, 164)",
            "composition": {
                "red": 164,
                "green": 164,
                "blue": 164
            }
        },
        "hsl": {
            "value": "hsl(20, 0%, 65%)",
            "composition": {
                "hue": 20,
                "saturation": 0,
                "lightness": 65
            }
        },
        "hsl_raw": {
            "value": "hsl(20.28777, 0%, 64.5098%)",
            "composition": {
                "hue": 20.28777,
                "saturation": 0,
                "lightness": 64.5098
            }
        }
    },
    "grayscale_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
            }
        }
    }
}