xColors is a completely free service that provides the ability to get random colors and convert them into various color models (HEX, RGB and HSL are supported). All data comes in a convenient JSON format, so you can immediately use them for styling in CSS without additional validation.
Get a JSON object that contains a random color in three HEX, RGB and HSL color models at once.
{ hex: "#BCB230", rgb: "rgb(188, 178, 48)", hsl: "hsl(56, 74%, 74%)" }
You can get random shades of the color you need. For example, using reserved names such as:
Instead of reserved words, you can use any number from the range [0, 359] - which corresponds to the HUE scale.
The number parameter allows you to get an array containing the desired number of random colors.
The type parameter allows you to get either only a dark or light shade of color. This allows you to know in advance what font color to use against the background of the resulting color. Usually, the font color is white on dark colors, and black on light colors.
It works if you have specified the { hue / color } you need or use all - for an any color.
You can freely convert colors between three color models. To do this, use the desired endpoint and use the value parameter to specify the color value of the color model, depending on the selected endpoint.