Palette kullanımı – ColorFromPalette

nblendPaletteTowardPalette ve ColorFromPalette ‘ın kullanımını öğrenmeye çalışıyorum.

The basic idea is that you always have a “current palette” that you’re
pulling colors from with ColorFromPalette, and you have a “target palette
which is the ‘next’ palette that you want to get to.

After that, implementation is relatively simple: just periodically call
nblendPaletteTowardPalette( currentPalette, targetPalette);

If the current palette is not yet equal to the target palette, this
function will make a few small changes to the current palette to make
it slightly more like the target. Over time, the current palette will
come to be equal to the target.

There’s no need to test the current and target for equality; it’s safe
to keep calling nblendPaletteTowardPalette even after current reaches target.
For faster blending, call nblendPaletteTowardPalette twice per loop.

Kod

 

Kendi paletlerimi yaratmak için:

 

ColorFromPalette( currentPalette, colorIndex + sin8(i * 16), brightness)

 

currentPalette:

 

ColorIndex: Paletteki her rengin sırası ile alakalı. 16 renk toplam 256 girdiye özetleniyor.

Index 0 : 1. Renk
Index 16 : 2. Renk
Index 32 : 3. Renk
Index 48  : 4. Renk
Index 64 : 5. Renk
Index 80 : 6. Renk
Index 96 : 7. Renk
Index 112 : 8. Renk
Index 128 : 9. Renk
Index 144 : 10. Renk
Index 160: 11. Renk
Index 176: 12. Renk
Index 192: 13. Renk
Index 208: 14. Renk
Index 224: 15. Renk
Index 240: 16. Renk

Brightness:

blending: NOBLEND, LINEARBLEND

 

Her renkten 16şar adet şerit sonuna kadar gösteriliyor. Renkler arası Geçişler sert.

 

Her renkten 16şar adet şerit sonuna kadar gösteriliyor. Renkler arası Geçişler yumuşak.

Leave a Reply

Your email address will not be published.