nanosvg icon indicating copy to clipboard operation
nanosvg copied to clipboard

Pixel format

Open sebopop opened this issue 7 years ago • 2 comments

Hi!

First, thanks for sharing!

I'd like to use nanosvg for a hobby OS, and tried it on a linux framebuffer, which happens to use a BGRA format. Could you add, if not a runtime option, at least a compile time option? Or should i make a pull request?

I also noticed some svg being misrendered in a framebuffer but rendered fine a png, does that makes sense to you?

Thanks!

sebopop avatar Apr 17 '17 12:04 sebopop

I think you can redefine the color code at compile time here: https://github.com/memononen/nanosvg/blob/master/src/nanosvg.h#L196

So it should work if you use #define NSVG_RGB(r, g, b) (((unsigned int)b) | ((unsigned int)g << 8) | ((unsigned int)r << 16))

Cultrarius avatar Jun 01 '17 19:06 Cultrarius

+1

SergeySlice avatar Jul 05 '18 17:07 SergeySlice