Inicio - Documentación - POM Theme - 11 Developers - Use color and icon helpers

Use color and icon helpers

Color helpers

Helper Public purpose
pom_get_custom_color_from_theme_options( $value ) Resolve a palette number; pass through a valid hex color or non-numeric custom value
pom_get_color_palette_array() Return the current numbered palette as entries containing hex
pom_color_convert( $operation, $value, $alpha = 1 ) Convert supported color representations
pom_hex_color_mod( string $hex, int $diff ) Lighten or darken a hexadecimal color by the supplied difference

Example:

$accent = pom_get_custom_color_from_theme_options( 3 );

if ( '' !== $accent ) {
    printf(
        '<span class="integration-label" style="--integration-accent:%s">%s</span>',
        esc_attr( $accent ),
        esc_html__( 'Featured', 'my-plugin' )
    );
}

Do not assume a palette always contains 15 user-defined values or embed the returned value into raw CSS without validation/escaping.

Icon code

POM identifies an icon as library/name, for example feather/arrow-right.

Helper Result
pom_normalize_icon_code_from_picker( $value ) Convert a picker URL or slug into the normalized code
pom_normalize_svg_icon_code( $code ) Validate and normalize library/name
pom_get_icon( $code, $with_i_tag = false ) Return the resolved inline SVG, optionally wrapped in POM's icon <i>
pom_get_svg_symbol_icon( $code, $with_i_tag = true ) Use the shared frontend SVG sprite where safe, with inline fallback for AJAX/REST/admin contexts
pom_get_icon_svg_markup( $code ) Return raw resolved SVG markup for a trusted renderer
pom_get_icons_libraries() Return libraries available to selectors
pom_get_icons_dir( $library ) Resolve the library paths used by POM

Preferred rendering:

if ( function_exists( 'pom_get_svg_symbol_icon' ) ) {
    echo pom_get_svg_symbol_icon( 'feather/arrow-right' ); // Trusted POM-rendered SVG.
}

Treat icon markup as trusted renderer output; do not concatenate untrusted attributes into it. Provide adjacent readable text or an accessible name when the icon conveys meaning. Decorative icons should remain hidden from assistive technology.