Close
Close full mode
logoMakeCode AP CSP

Hexadecimal in MakeCode

Color Numbers

Find your favorite colors using the Canva Color Wheel. Record the hex-codes of those colors in your OneNote.

As you know from creating your sprites, MakeCode Arcade has a palette of 16 colors - 15 colors and transparent. What if you could add your favorite color to the palette?

  1. Go to the MakeCode Color Palette document.

  2. Replace two (or more) of the colors with your favorite complementary colors from the Canva color wheel. Make sure there are no extra spaces before or after the # (pound sign) or " (quotes).

  3. Open arcade.makecode.com, and start a new project called myColors.

  4. Drag a Set mySprite block into the On Start block:

mySprite block
mySprite block

  1. Switch to JavaScript:

JavaScript Button
JavaScript Button

  1. Click to expand the Explorer pane under the simulator:

Explorer Panel Dropdown
Explorer Panel Dropdown

  1. Click the pxt.json file and the click on Edit Settingts As Text.

Edit Settings as Text
Edit Settings as Text

  1. Click after tsprj (after the closing quotes):

Edit Settings as Text
Edit Settings as Text

  1. Type comma and hit enter

  2. Copy your new color palette code from the Word document and paste it in here. Make sure it is after the comma you just typed and before the closing curly bracket:

Pallete Settings
Pallete Settings

  1. Click main.ts to refresh game:

main.ts file

  1. Open up the Sprite Editor to draw your sprite and see the new colors!

New color pallete
New color pallete

  1. Click on the Sprite Gallery to see how your palette mods changed the other sprites in the gallery!

Sprite Gallery
Sprite Gallery

Note that this custom color palette only impacts the current project. And you must be in JavaScript to access the file Explorer.

Learn more

πŸ“˜ Unit 6 - DAT β€” Previous
Base 62 and URL Shorteners
Next β€” πŸ“˜ Unit 6 - DAT
Extra Practice: Hexadecimal to Binary