Commit Graph

37 Commits (master)

Author SHA1 Message Date
Ben Moon 56d6868480 RgbColor: Add support for color titles (#3574)
* Add color titles to output

* Add titles for color in front-end (hover)

Hovering over the circle gives the color 'title', and hovering over a
hex value gives the color 'name' (more suitable for HTML and similar).
2016-09-26 12:38:31 -04:00
Ben Moon 6e31737cdd Add support for three-digit hex codes 2016-08-13 11:08:02 +01:00
Ben Moon d17319fdf2 Remove trailing space from subtitle prefixes 2016-08-06 18:19:58 +01:00
Ben Moon eb7e4a5813 Ensure trailing punctuation is ignored 2016-07-23 19:14:10 +01:00
Ben Moon 772e6c8542 Update tests and fix logic for new front-end 2016-07-08 10:29:38 +01:00
Ben Moon 80f4c32c14 Add support for basic '+' forms
E.g., `blue + black =`.

Currently does NOT support '+' on its own, e.g., `blue + black`.
2016-07-07 14:06:13 +01:00
Ben Moon ec56c99756 Improve support for multi-word colors
Ensure the user can type 'x-y', 'x y' or 'xy' to match a color.
2016-07-07 13:44:44 +01:00
Ben Moon 46ca72219a Add support for infix mix/tint queries
And vastly improve execution and regexp compilation time.

1. Add some early-bail shortcuts so we don't need to check massive
regexes each time.

2. Reduce some duplication of regexes and matching.

3. Improve regexes.
2016-07-06 13:55:07 +01:00
Ben Moon 04614f1f30 Add support for tinting colors 2016-07-06 12:49:41 +01:00
Ben Moon cf6fd709c0 Add support for percentages in mixing
E.g., `mix 50% blue with 50% black`.
2016-07-06 12:10:46 +01:00
Ben Moon 3983157ac3 Ensure (mix) amounts are normalized for template
Instead of passing 'parts' or 'percent' etc., just pass a decimal that
we can do with what we will in the 'front' end.
2016-07-06 11:52:51 +01:00
Ben Moon f3c205cde2 Add support for 'parts' in mixing
E.g., `mix 5 parts blue and 6 parts red`.
2016-07-06 11:36:39 +01:00
Ben Moon 9675e8edb1 Add some basic custom stop words
'make', 'makes', 'paint', and 'paints'; just some common words that pop
up in queries relating to color.
2016-07-05 21:34:23 +01:00
Ben Moon 76495ed45a Add support for 'mixing' form 2016-07-05 21:31:17 +01:00
Ben Moon 06e0da0503 Add support for 'with' in mixing
E.g., `mix white with black`.
2016-07-05 21:23:39 +01:00
Ben Moon ee5e5e7e51 Vastly increase number of supported (named) colors
From about ~100-200 to upwards of 10,000 (at the cost of a little
speed).
2016-07-05 19:04:50 +01:00
Ben Moon 5c00057dd3 Add support for 'mixed' and improve relevancy
This relevancy check (stopwords) seems to do a pretty decent job.
Unfortunately there are a lot of queries involving colors - many valid
and many invalid.
2016-07-05 16:11:11 +01:00
Ben Moon 92a5b307c1 Allow using the plural of color (though singular)
Currently only returning single results, but we probably want to catch
queries like `random colors`.
2016-07-05 15:26:22 +01:00
Ben Moon 88317a6394 Add support for additional 'opposite' forms
* Complementary
* Can use 'for|of|to'
2016-07-05 15:21:36 +01:00
Ben Moon 51d1294bcc Ensure it is clear that opposites are for RGB
People may mean the 'RBY' model, so ensure they can see this is RGB.

*Todo: Support the 'traditional' model in the future.*
2016-07-05 15:09:50 +01:00
Ben Moon 65b293005a Add support for opposite colors 2016-07-05 14:42:41 +01:00
Ben Moon be81fa4df2 Add more sample queries (some with potential) 2016-07-05 14:03:23 +01:00
Ben Moon f4fa95c8ba Add additional sample queries
* Ensure we can trigger 'mix' in the middle of a sentence.
2016-07-05 13:55:17 +01:00
Ben Moon 43abe8678f Add invalid queries from sampling
A.k.a. the 'query suggestion' method.
2016-07-05 13:48:06 +01:00
Ben Moon c12a1ac994 Add support for common names in output
If there is a 'common' name available for the color, display that along
with the hex code.
2016-07-05 12:56:04 +01:00
Ben Moon 8316a69f73 Add support for bounds in random colors
E.g., `random color between blue and green`.
2016-07-05 12:28:40 +01:00
Ben Moon 09d622130e Add support for named colors
E.g., in `mix blue and red`.
2016-07-05 12:03:59 +01:00
Ben Moon 5707700a7c Allow use of 'and' when mixing colors 2016-07-05 11:50:31 +01:00
Ben Moon 67460e170d Allow leading '#' for hex colors 2016-07-05 11:49:19 +01:00
Ben Moon 942c87147b Add support for mixing two colors 2016-07-05 11:45:40 +01:00
Ben Moon f12586eb5f Allow using 'rand' instead of 'random' 2016-07-05 11:31:33 +01:00
Ben Moon a6c557c112 Ensure basic invalid queries do not trigger 2016-07-05 11:25:48 +01:00
Ben Moon c35d489c48 Replace use of 'content' with 'title_content'
We'll only be modifying the subtitle and title, so use the provided
content templates.
2016-07-05 10:58:39 +01:00
Ben Moon b132ab9026 Add a colored box to title
1. Add a '#' to the front of hex colors.
2. Display a colored box along with the hex value of the color.
2016-07-05 09:52:14 +01:00
Ben Moon a95a74a5b0 Add support for 'colour' form 2016-07-05 09:38:04 +01:00
Ben Moon 718820888f Add support for basic random color queries 2016-07-05 09:33:50 +01:00
Ben Moon 85bac4f846 Rename 'RGBColor' to 'RgbColor'
Due to the way the package name is handled in the metadata, `RGBColor`
causes some attributes to become `rgbcolor` rather than `rgb_color` (for
the latter `RgbColor` is required).
2016-07-05 08:52:33 +01:00