Commit Graph

16 Commits

Author SHA1 Message Date
Andre Mohren
006a87692a Removed unused imports. 2020-07-28 18:22:51 +02:00
Robert
885931ae74 Run every color validation together
This ensures that color picks that have multiple issues will
have them all checked at the same time, including ensuring that
the fix for one issue doesn't cause another issue.

Handling of the onError action has been changed from being called
at once to collecting the potential errors in a HashSet to deduplicate
them and then calling onError after a valid color has been found.
(Otherwise you would in the worst case get 256 error messages logged!)
2020-02-22 16:31:29 +00:00
Robert
4d4f1d6068 Avoid null vectors when making colors valid
If the picked color and a forbidden color are identical (like
if they both picked the same palette color and in the special case
when a picked color is outside of the allowed range and the method
returns the picked color as the forbidden color),
the vector between them is zero and the maths for adjusting
the color fails by hitting the iteration limit. This changes
the zero vector to the smallest possible vector in order to
avoid the issue.

This can result in some seriously close adjustments in the case of
picking identical palette colors, which might
be undesirable compared to picking a new palette color.
2020-02-22 16:31:29 +00:00
Robert
fafa219d11 Added error message if color could not be adjusted
The failsafe in ColorValidator aborts after 255 iterations of
adjusting the color and picks a random color. This message makes it
clearer to the user. Results in two messages being displayed,
first one about adjusting and the about a random color pick.
2020-02-22 16:31:29 +00:00
abcdefg30
23b3c237b7 Update the year numbers in all license headers to 2020 2020-01-05 17:00:34 +00:00
Paul Chote
ebf2ce32c0 Make sure braces for multi-line statements are on their own lines. 2019-06-08 19:26:53 +02:00
Paul Chote
3e404f6ac2 Remove HSLColor. 2019-03-04 18:26:42 +00:00
Paul Chote
ab4a7e3558 Replace System.Drawing primitives with our own. 2019-03-04 18:26:42 +00:00
abcdefg30
cadbd0d9ab Change the year number in all cs headers from 2018 to 2019 2019-01-26 23:15:21 +01:00
David Wilson
9bc9ce4577 Color picker update with team color presets. Bots added will use available team color presets by default 2018-03-18 23:29:47 -03:00
Arular101
8a60918841 Update copyright notice year to 2018 2018-01-17 00:47:34 +01:00
Taryn Hill
43317e0f5d Update copyright notice year to 2017 2016-12-31 23:46:13 -06:00
Paul Chote
e71225496b Clarify GPL version. 2016-02-21 16:30:48 +00:00
Paul Chote
b396965fd9 Update licence header year. 2016-02-21 16:27:31 +00:00
Paul Chote
7638746069 Define additional constraints in HSV space. 2016-01-27 19:56:04 +00:00
Paul Chote
617295cc91 Overhaul color validator logic. 2016-01-27 19:49:03 +00:00