How can i add model configuration (using a macro on {{this}}) in dbt_project.yml

I want to add node_color to all of my dbt models based on my filename prefix to make it easier to navigate through my dbt documentation :

fact_ => red
base__ => black.

To do so i have a macro that works well :

{% macro get_model_color(model) %}

    {% set default_color = 'blue' %}
    {% set ns = namespace(model_color=default_color) %}

    
    {% set dict_patterns = {"base__[a-z0-9_]+" : "black", "ref_[a-z0-9_]+" : "yellow", "fact_[a-z0-9_]+" : "red"} %}

    {% set re = modules.re %}

    {% for pattern, color in dict_patterns.items() %}

        {% set is_match = re.match(pattern, model.identifier, re.IGNORECASE) %}
        {% if is_match %}
            {% set ns.model_color = color %}
        {% endif %}
        
    {% endfor %}

    {{ return({'node_color': ns.model_color}) }}
{% endmacro %}

And i call it in my model .sql :

{{config(
    materialized = 'table',
    tags=['daily'],
    docs=get_model_color(this),
)}}

This works well but force me to add this line of code in all my models (and in all the new ones).

Is there a way i can define it in my dbt_project.yml to make it available to all my models automatically?

I have tried many things like the config jinja function or this kind of code in dbt_project.yml

    +docs:
        node_color: "{{ get_model_color(this) }}"

returning Could not render {{ get_model_color(this) }}: 'get_model_color' is undefined

But nothing seems to work

Any idea? Thanks

@ludovic.gayet Did you ever figure this out? I am running into similar issue