I have a simple task - to make a function that populate a palette with monochrome colors, depending on BPP (2, 3, 4, 8 ).
Could you share how you gonna wright that function in a program language of your choice? The function gets 2 parameters:
- Pal - this is our palette. Think of it as array of integer (4 bytes per entry)
- Num - number of possible colors. Num = 2 ^ BPP. So Num will be 4, 8, 16, 256.
I have to specify that palettes entries are in the format ARGB, 8 bits each. For the sake of this task we don care about A, so you may assume it is 0.