4 ms·
> The position of commas in the rgb array are triggering me You mean: { "colors": [ { "color": "black" , "hex": "#000", "rgb": [ 0, 0,
by Zecc 6y ago
> The position of commas in the rgb array are triggering me
You mean:
{
"colors": [
{ "color": "black" , "hex": "#000", "rgb": [ 0, 0, 0 ] },
{ "color": "red" , "hex": "#f00", "rgb": [ 255, 0, 0 ] },
{ "color": "yellow" , "hex": "#ff0", "rgb": [ 255, 255, 0 ] },
{ "color": "green" , "hex": "#0f0", "rgb": [ 0, 255, 0 ] },
{ "color": "cyan" , "hex": "#0ff", "rgb": [ 0, 255, 255 ] },
{ "color": "blue" , "hex": "#00f", "rgb": [ 0, 0, 255 ] },
{ "color": "magenta", "hex": "#f0f", "rgb": [ 255, 0, 255 ] },
{ "color": "white" , "hex": "#fff", "rgb": [ 255, 255, 255 ] }
]
}
- mschuetz 6y agoYou mean: { "colors": [ { "color": "black" , "hex": "#000", "rgb": [ 0, 0, 0 ] }, { "color": "red" , "hex": "#f00", "rgb": [ 255, 0, 0 ] }, { "color": "yellow" , "hex": "#ff0", "rgb": [ 255, 255, 0 ] }, { "color": "green" , "hex": "#0f0", "rgb": [ 0, 255, 0 ] }, { "color": "cyan" , "hex": "#0ff", "rgb": [ 0, 255, 255 ] }, { "color": "blue" , "hex": "#00f", "rgb": [ 0, 0, 255 ] }, { "color": "magenta", "hex": "#f0f", "rgb": [ 255, 0, 255 ] }, { "color": "white" , "hex": "#fff", "rgb": [ 255, 255, 255 ] }, ] }
- jng 6y agoThe last extra comma is valid javascript, but, (possibly) unfortunately, invalid JSON.
- deleted 6y ago[deleted]
- jng 6y agoExactly. I format things like that in my source code. Anything else is too painful to bear. When code by other people who don't care about those things, it's hard to understand :)
- Pxtl 6y agoAnd then somebody wants to edit the file your careful alignment gets gradually mangled and there's no tooling to auto-do it and we refactor something globally and it gets worse and ultimately I go shift-alt-F to restore it to autoformatted sanity.