JavaScript
Article
By Sam Deering

Example Colors JSON File

By Sam Deering
Last chance to win! You'll get a... FREE 6-Month Subscription to SitePoint Premium Plus you'll go in the draw to WIN a new Macbook SitePoint 2017 Survey Yes, let's Do this It only takes 5 min

This is an example of a Colors JSON file which you might see used to store configuration settings to setup your system. It might also be used to contain color information which can be easily shared across components using the simple JSON format.

Also: See more JSON examples.

{
    "colorsArray":[{
            "colorName":"red",
            "hexValue":"#f00"
        },
        {
            "colorName":"green",
            "hexValue":"#0f0"
        },
        {
            "colorName":"blue",
            "hexValue":"#00f"
        },
        {
            "colorName":"cyan",
            "hexValue":"#0ff"
        },
        {
            "colorName":"magenta",
            "hexValue":"#f0f"
        },
        {
            "colorName":"yellow",
            "hexValue":"#ff0"
        },
        {
            "colorName":"black",
            "hexValue":"#000"
        }
    ]
}

Or simply:

{
    "colorsArray":[{
            "red":"#f00",
            "green":"#0f0",
            "blue":"#00f",
            "cyan":"#0ff",
            "magenta":"#f0f",
            "yellow":"#ff0",
            "black":"#000"
        }
    ]
}

Or even simply:

--ADVERTISEMENT--

{
    "red":"#f00",
    "green":"#0f0",
    "blue":"#00f",
    "cyan":"#0ff",
    "magenta":"#f0f",
    "yellow":"#ff0",
    "black":"#000"
}
Login or Create Account to Comment
Login Create Account
Recommended
Sponsors
Get the most important and interesting stories in tech. Straight to your inbox, daily.
Is it good?Is it good?