Skip to content

Instantly share code, notes, and snippets.

@hbons
Created November 7, 2024 15:28
Show Gist options
  • Save hbons/e1d96684870ced8b64892a940a8bce40 to your computer and use it in GitHub Desktop.
Save hbons/e1d96684870ced8b64892a940a8bce40 to your computer and use it in GitHub Desktop.
NES palette defines
const palette_color_t P_LEAF[4] = {
NES_BLACK,
NES_ORANGE_2,
NES_YELLOW_3,
NES_RED_1
};
// Based on nes/rgb_to_nes_macro.h and the Aseprite NES palette
#define NES_BLACK 0x1D
#define NES_WHITE 0x30
#define NES_GRAY_1 0x2d
#define NES_GRAY_2 0x3d
#define NES_GRAY_3 0x00
#define NES_GRAY_4 0x10
#define NES_GRAY_5 0x20
#define NES_CYAN_1 0x0c
#define NES_CYAN_2 0x1c
#define NES_CYAN_3 0x2c
#define NES_CYAN_4 0x3c
#define NES_TEAL_1 0x0b
#define NES_TEAL_2 0x1b
#define NES_TEAL_3 0x2b
#define NES_TEAL_4 0x3b
#define NES_GREEN_1 0x0a
#define NES_GREEN_2 0x1a
#define NES_GREEN_3 0x2a
#define NES_GREEN_4 0x3a
#define NES_LIME_1 0x09
#define NES_LIME_2 0x19
#define NES_LIME_3 0x29
#define NES_LIME_4 0x39
#define NES_YELLOW_1 0x08
#define NES_YELLOW_2 0x18
#define NES_YELLOW_3 0x28
#define NES_YELLOW_4 0x38
#define NES_ORANGE_1 0x07
#define NES_ORANGE_2 0x17
#define NES_ORANGE_3 0x27
#define NES_ORANGE_4 0x37
#define NES_RED_1 0x06
#define NES_RED_2 0x16
#define NES_RED_3 0x26
#define NES_RED_4 0x36
#define NES_PINK_1 0x05
#define NES_PINK_2 0x15
#define NES_PINK_3 0x25
#define NES_PINK_4 0x35
#define NES_VIOLET_1 0x04
#define NES_VIOLET_2 0x14
#define NES_VIOLET_3 0x24
#define NES_VIOLET_4 0x34
#define NES_PURPLE_1 0x03
#define NES_PURPLE_2 0x13
#define NES_PURPLE_3 0x23
#define NES_PURPLE_4 0x33
#define NES_INDIGO_1 0x02
#define NES_INDIGO_2 0x12
#define NES_INDIGO_3 0x22
#define NES_INDIGO_4 0x32
#define NES_BLUE_1 0x01
#define NES_BLUE_2 0x11
#define NES_BLUE_3 0x21
#define NES_BLUE_4 0x31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment