You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -170,7 +171,7 @@ Another good thing to do before you ask for help is try testing what you have in
170
171
171
172
# Return the Color Name for a Provided rgb Number
172
173
173
-
## `rgb2name(_range, rgbl)`
174
+
## `rgb2name(range, rgb_formatted_list)`
174
175
175
176
This template will accept a list representing an RGB value plus a range value representing the window size of the 'close enough' color name. It will return the Home Assistant Color name that matches it or is close to it within a +/- range you specify.
176
177
@@ -180,11 +181,16 @@ Another good thing to do before you ask for help is try testing what you have in
180
181
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.
181
182
182
183
SAMPLE USAGE:
183
-
{% from 'color_multi_tool.jinja' import rgb2name %}
184
-
{{ name2rgb(color_name) }}
184
+
185
+
```jinja
186
+
{% from 'color_multi_tool.jinja' import name2rgb %}
187
+
{{ rgb2name(10, rgbl) | list }}
188
+
```
185
189
186
190
REMEMBER:
187
191
Everything returned from a macro template is a string.
192
+
In this case, it will be a string that looks like a list of strings.
193
+
You will need to cast it to actually be a list.
188
194
189
195
*********************
190
196
@@ -204,8 +210,8 @@ Another good thing to do before you ask for help is try testing what you have in
204
210
205
211
```jinja
206
212
{% from 'color_multi_tool.jinja' import rgb2xy %}
207
-
{% set _rgb2xy = rgb2xy(_nrgb).split(",") | list -%}
0 commit comments