Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Search for colors containing a given string
ResourceFunction["ColorSearch"][str] returns a list with the colors that contain the string str in their names. | |
ResourceFunction["ColorSearch"][str,rtype] gives the result type specified by rtype. |
| "Entity" | color Entity for each color in the search result |
| "RGB" | RGBColor for each color in the search result |
| "Name" | string with the name of each color in the search result |
| {rtype1,rtype2,…} | list with each value type in the specified order |
| All | Association of all rtype values for each color in the search result |
Find all the colors related to the word "sun":
| In[1]:= |
|
| Out[1]= |
|
Find all the colors related to the word "nature":
| In[2]:= |
|
| Out[2]= |
|
See the names that matched the search term:
| In[3]:= |
|
| Out[3]= |
|
Find all the colors related to the word "love":
| In[4]:= |
|
| Out[4]= |
|
Find all the colors related to the words "red" and "blue":
| In[5]:= |
|
| Out[5]= |
|
Use the second argument to get an RGBColor for each color:
| In[6]:= |
|
| Out[6]= |
|
Get an Entity for each color:
| In[7]:= |
|
| Out[7]= |
|
Get a String with the name of each color:
| In[8]:= |
|
| Out[8]= |
|
Get a list of associations with all the values for each color:
| In[9]:= |
|
| Out[9]= |
|
| In[10]:= |
|
| Out[10]= |
|
Get an RGBColor and a String with the name of each color:
| In[11]:= |
|
| Out[11]= |
|
Use this function to find all the colors related to the nouns in a sentence:
| In[12]:= |
|
| Out[12]= |
|
| In[13]:= |
|
| Out[13]= |
|
| In[14]:= |
|
| Out[14]= |
|
By default, the IgnoreCase option is False:
| In[15]:= |
|
| Out[15]= |
|
Setting IgnoreCase to True gives more results:
| In[16]:= |
|
| Out[16]= |
|
| In[17]:= |
|
| Out[17]= |
|
Because of the great number of colors in the Wolfram Language, the function can take some time to perform the search:
| In[18]:= |
|
| Out[18]= |
|
Use the function to sort, in ascending order, a set of colors related to the words "orange", "purple" and "pink" according to their brightness:
| In[19]:= |
|
| Out[19]= |
|
This work is licensed under a Creative Commons Attribution 4.0 International License