NewGRF Technical Discussions • Re: Creating custom colours
Here's an example: https://github.com/GraionDilach/univers ... #L155-L437
The additional company gradients are EmperorJake's NewCC though, so if you don't use GPLv2, you might not be able to use them. (I duplicate the company colors outright so that if a user enables NewCC, it will not affect my remap at all.)
In general though, you need to basically build up a list of gradient remaps with a reserve_sprites/replace combination and then build a similar switch block to easily refer the additional gradients - and then you can use those named switches exactly the way you'd use the current gradients. (You can reserve the sprites one by one as well, but that balloons the ActionD registers, so it's better if you reserve recolor sprites in blocks.)
I didn't really bother with 2cc though - it would basically follow this same principle, but would need to be a table in terms of allocation. I know how it would look in practice (I'd do a struct+CC table myself anyway, because I'm doing house NewGRFs), but couldn't be bothered to generate that combination table yet.
Statistics: Posted by Graion Dilach — 28 Apr 2026 14:35
Discussion in the ATmosphere