Sprite Editor Color View

I used the Color fading extension to change the RGBs, but I wish the right colors would show up in the art editor. Is there a way to do this in JavaScript?

(Gray Scale Example) https://makecode.com/_h8MdpuJyaYsp

2 Likes

You can make the change in JavaScript and then go back to blocks, but it’s a little tricky.

Warning: you can accidentally break your project forever by following these steps! Make sure you save or share a copy first before continuing

First, get your colors. You need to have 15 colors in the format #FFFFFF. For this example I’ll be using these grayscale colors:

#FFFFFF
#EDEDED
#DBDBDB
#C8C8C8
#B6B6B6
#A4A4A4
#929292
#808080
#6D6D6D
#5B5B5B
#494949
#373737
#242424
#121212
#000000

We are going put these colors into the pxt.json for the project. This is a configuration file that is saved in every project that contains things like the project name, description, list of files, etc.

once again:

Never edit pxt.json unless you know what you are doing! It can break your project forever!!!

Okay, with that out of the way we need to put these into the format that we can copy/paste in that file:

    ,"palette": [
        "#000000",
        "#FFFFFF",
        "#EDEDED",
        "#DBDBDB",
        "#C8C8C8",
        "#B6B6B6",
        "#A4A4A4",
        "#929292",
        "#808080",
        "#6D6D6D",
        "#5B5B5B",
        "#494949",
        "#373737",
        "#242424",
        "#121212",
        "#000000"
    ]

The first color in that list should always be #000000 (that color is used for transparency and you can’t change it). The next 15 colors should be the ones you are trying to use. So, in total, there are 16 colors in this list. I recommend that you copy and paste the example I gave here and put your colors into it. The commas, quotation marks, and square brackets all need to be just as they appear in this example

Now let’s insert this into our pxt.json. For a third and final time:

ONLY DO THIS IF YOU HAVE DOWNLOADED A COPY OF YOUR PROJECT!!! WHEN POSSIBLE, DO THIS IN A BLANK PROJECT SO THAT YOU DON’T LOSE WORK

  1. Switch to JavaScript
  2. Click on the explorer beneath the simulator (if you don’t see it, then you need to make the window fullscreen)
  3. Click the entry for pxt.json
  4. Click “edit settings as text”
  5. Scroll down to the second to last line. the one just before the }
  6. Create a new line and paste the palette text there (before the })
  7. Click “JavaScript” in the topbar to return to the JavaScript editor
  8. Click “Blocks” to return to your blocks file.
  9. The sprite editor should now have the new colors! You might need to refresh the page.

Here is GIF of me doing this:

5 Likes

This really helps, thanks!

My palette! :art:

3 Likes

Can you like add a color for me with my pokemon? I really don’t want to risk my project and all my coloring stuff.

image
This is me copying my projects just in case.


Here is the link. Can you add just a gray color to the palette please?
1 Like



This is usually what I need the gray for

2 Likes

If you add gray, you will have to take away one color.

The dark purple I won’t use so that might be what I want to take away

will this work on devices like the brainpad?

is this good?

1 Like

changing the palette via pxt.json (or whatever file it is) or the color fading extension works on hardware.

1 Like

I don’t know what to look at in this game

ok now I see it. Do you think you can make the gray a bit darker?
image
This kind of gray but darker

1 Like

could you maybe give me a hex code so i can put it in?

What’s a hex code?

if you look it up, it’s basically a code for a certain color like #000000 i think is the code for black and #ffffff is pure white

1 Like

Good website


This gray?

1 Like

Oh Wow!! Is that how you chose your color palette?

No, it’s just to find hex, RGB and HSL

1 Like

Hi @richard!
Can you paste the normal color palette here, please? I’m going to need it so then I can edit the palette for myself. I’m starting to get the hang of it (thankfully it hasnt crashed my game yet…) I feel like its going to happen at some point. lol

And thanks @GameGod for sharing me the website to find hexes

1 Like