void RCTContextSetFillColorWithUint(IntPtr cr, uint color) { uint b = color & 0xFF; uint g = (color >> 8) & 0xFF; uint r = (color >> 16) & 0xFF; Cairo.cairo_set_source_rgba(cairo, r, g, b, 1); //black alpha default }
public void RCTUIGraphicsBeginImageContext(CGSize size, Color backgroundColor, bool hasCornerRadii, bool drawToEdge) { /// create cairo surface and context here surface = Cairo.cairo_image_surface_create(0, 1920, 1080); cairo = Cairo.cairo_create(surface); /* clear background as white */ Cairo.cairo_set_source_rgba(cairo, 1, 1, 1, 1); Cairo.cairo_paint(cairo); // set default stroke line width and color for Cairo context Cairo.cairo_set_line_width(cairo, 1.0); Cairo.cairo_set_source_rgba(cairo, 0, 0, 0, 1); //black line }
void RCTContextSetFillColorWithColor(IntPtr cr, Color color) { // set with Color parsed value Cairo.cairo_set_source_rgba(cairo, color.R, color.G, color.B, color.A); }