Need help with color transparency

General

Halflife

6 years ago

Hello, i am trying to make the white pixels in my image to be transparent and i don't know what to put as parameter.

const uint8_t witchData[] = {
    16, 16, 
    1, 0, 
    1, 
    0x77, //transparent color ?
    1, 
    0x77, 0x77,0x77, 0x77,0x77, 0x77,0x77, 0x77,
    0x77, 0x77,0x77, 0x77,0x00, 0x00,0x77, 0x77,
    0x77, 0x77,0x77, 0x00,0x00, 0x11,0x07, 0x77,
    0x77, 0x77,0x00, 0x00,0x01, 0x11,0x07, 0x77,
    0x77, 0x70,0x00, 0x00,0x11, 0x10,0x07, 0x77,
    0x70, 0x00,0x00, 0x00,0x11, 0x07,0x07, 0x77,
    0x77, 0x01,0x1f, 0x10,0x01, 0x07,0x77, 0x77,
    0x77, 0x70,0xff, 0xf1,0x00, 0x07,0x77, 0x77,
    0x77, 0x70,0x3f, 0xf3,0x10, 0x00,0x07, 0x77,
    0x77, 0x70,0xff, 0xff,0xf1, 0x07,0x77, 0x77,
    0x77, 0x77,0x00, 0x11,0x11, 0x07,0x77, 0x77,
    0x77, 0x77,0x00, 0xdd,0x11, 0x77,0x77, 0x77,
    0x77, 0x70,0x00, 0x0d,0xd1, 0x77,0x99, 0x77,
    0x77, 0x55,0x50, 0x0d,0xd1, 0x55,0x99, 0x97,
    0x77, 0x77,0x77, 0x00,0x00, 0x07,0x79, 0x97,
    0x77, 0x77,0x77, 0x70,0x70, 0x77,0x77, 0x79
    };

Sorunome

NEW 6 years ago

color index for white is 7, so transparent color should just be 0x07, not 0x77

Halflife

NEW 6 years ago

Thank you, it solved my problem. Where can i find the other colors indexes ?

Sorunome

NEW 6 years ago

https://github.com/Gamebuino/Gamebuino-META/blob/master/src/utility/Graphics/Graphics.cpp#L56-L73

Top one is zero, then 1, then 2 etc.


I really need to document this somewhere

Halflife

NEW 6 years ago

Thank, you for your time. When you add it somewhere can you delete this Subject ?

Aurélien Rodot

NEW 6 years ago

Damn I really have to update the palette order and document that :P

@Sorunome okay I didn't see that you're on it too ^^

dreamer3

NEW 6 years ago

While you're at it a palette reference file for Asesprite would be nice too.