Skip to content

Instantly share code, notes, and snippets.

@Flicksie
Last active June 3, 2022 08:07
Show Gist options
  • Save Flicksie/26816ba856a611230f2fb607b21b8536 to your computer and use it in GitHub Desktop.
Save Flicksie/26816ba856a611230f2fb607b21b8536 to your computer and use it in GitHub Desktop.
List of pure colors supported by the Sega Mega Drive
const colors = [];
const steps = [ 0, 0x34, 0x57, 0x74, 0x90, 0xAC, 0xCE, 0xFF ];
for (color = 0; color <= 0777; color++){
colors.push( '#' +
color
.toString(8)
.padStart(3,'0')
.split('')
.map( c => steps[c].toString(16).padStart(2,'0') )
.join('')
);
}
colors;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment