';
/**
* Returns a base64 encoded version of the SVG.
*
* @since 1.28.0
*
* @param string $source SVG icon source.
* @return string Base64 representation of SVG
*/
public static function to_base64( $source = self::XML ) {
return base64_encode( $source );
}
/**
* Returns SVG XML with fill color replaced.
*
* @since 1.28.0
*
* @param string $color Any valid color for css, either word or hex code.
* @return string SVG XML with the fill color replaced
*/
public static function with_fill( $color ) {
return str_replace( 'white', esc_attr( $color ), self::XML );
}
}