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

1.1.1 working #26

Merged
merged 30 commits into from
Jun 12, 2016
Merged

1.1.1 working #26

merged 30 commits into from
Jun 12, 2016

Conversation

NorthernRealities
Copy link
Owner

No description provided.

NorthernRealities and others added 30 commits March 20, 2016 11:19
Added function to convert a number to a String so that all of the
subclasses could use. The idea is to call this function with guard
instead of using an if-else statement and nesting the other code that
depends on the String.

There are also two constants defined with this change that are used for
determining the number of digits after the decimal place when
formatting a number as a String.  One is used for alpha values and the
other for colour fractions (colours who have values represented between
0 and 1).
Using the guard statement to clean up the code. The alpha value now
gets formatted before being printed so it doesn’t have a long string of
numbers after the decimal point.
Breaking out common parts of regular expressions and storing them into
variables so that they only need to be changed in one place. I’ve also
found that there were some inconsistencies in how some things were
searched for in between different seekers so this will resolve that.

All basic search elements, such as how to find a float between 0 and 1,
will be defined in Seeker. This is then used in all of the sub-classes
in a consistent manner. If it needs to be changed it’s done in one
place and everything else sees that change right away.
Also added support for “.init” to match.
The latest release of the Rainbow-Creator module added a function that
aids in creating HSB colours and this update supports that function in
ColorSenseRainbow.
It was  writing the complete value of alpha no matter how many decimal
places it was before and now it uses a number formatter to truncate it
to the proper number of decimal places (defined to be two currently).
Also defined a new constant for integer values between 0 and 299
inclusive.
It’s only used in this class so this was the better place to define it.
A comment was made in the superclass that it exists here to stop
someone from creating a duplicate in the future.
Also changed some constants with respect to the regular expressions in
Seeker.swift.
The number of decimal places in the formatting of the numbers is now
correct. Before it was using the value for the alpha formatting for the
other numbers and it wasn’t formatting the alpha value at all.
@NorthernRealities NorthernRealities merged commit 6f94568 into master Jun 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant