Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change output of rgb2name to csv string #5

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions color_multi_tool.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,11 @@
> If you think that +10/-10 is close enough, then set the range to 10.

For default the color is set to black [0,0,0] and the range is 0, so it will
by give you black for invalid input.
give you black for invalid input.

SAMPLE USAGE:
{% from 'color_multi_tool.jinja' import rgb2name %}
{{ name2rgb(color_name) }}
{{ rgb2name(color_name) }}

REMEMBER:
Everything returned from a macro template is a string.
Expand Down Expand Up @@ -206,13 +206,13 @@
selectattr('g', 'le', _Gl) |
selectattr('b', 'ge', _Bg) |
selectattr('b', 'le', _Bl) |
map(attribute='color') | list | default(['black']) %}
map(attribute='color') | list | default(['black']) | join(',') %}
{{- out -}}
{%- else %}
{#- Input was not valid #}
{{-['black'] | list -}}
{{- 'black' -}}
{%- endif %}
{% endmacro %}
{%- endmacro %}

{% macro rgb2xy(rgbl) %}
{#-
Expand Down