Logo Search packages:      
Sourcecode: inkscape version File versions  Download package

void sp_svg_write_color ( gchar *  buf,
unsigned const   buflen,
guint32 const   rgba32 
)

Converts an RGBA32 colour to a CSS/SVG representation of the RGB portion of that colour. The result is valid even in SVG Tiny or non-SVG CSS.

Parameters:
rgba32 Colour expressed in form 0xrrggbbaa.
Precondition:
buflen >= 8.

Definition at line 430 of file svg-color.cpp.

References rgb24_to_css().

Referenced by sp_desktop_set_color(), sp_feDiffuseLighting_write(), sp_feSpecularLighting_write(), sp_gradient_repr_write_vector(), sp_stop_write(), and sp_style_write_ipaint().

{
    g_assert(8 <= buflen);

    unsigned const rgb24 = rgba32 >> 8;
    if (prefs_get_int_attribute("options.svgoutput", "usenamedcolors", 0)) {
        rgb24_to_css(buf, rgb24);
    } else {
        g_snprintf(buf, buflen, "#%06x", rgb24);
    }
}


Generated by  Doxygen 1.6.0   Back to index