Skip to content

Instantly share code, notes, and snippets.

@jtsternberg
Last active February 8, 2022 22:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jtsternberg/6fd7e567d35da410898974ff4b0bf561 to your computer and use it in GitHub Desktop.
Save jtsternberg/6fd7e567d35da410898974ff4b0bf561 to your computer and use it in GitHub Desktop.
Log colors to console (and show colors) in a group
var colors = ['#EC0089','#0C1127','#00cfed'];
console.group('colors', {colors});
colors.forEach(c => console.log(`%c `,
`
display: block;
background: ${c};
width: 5px;
height: 5px;
padding: 5px 5px;
`
) );
console.groupEnd('colors');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment