-
Notifications
You must be signed in to change notification settings - Fork 0
Add hsb functions to Ops8/Ops16. #13
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
base: master
Are you sure you want to change the base?
Conversation
| * Returns a color given hue, saturation, brightness, and alpha. | ||
| */ | ||
| public static long hsba(double hue, double saturation, double brightness, double alpha) { | ||
| hue = hue * 360; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line doesn't look like it should be here.
src/com/symmetrylabs/color/Ops8.java
Outdated
| public static int blue(int argb) { return argb & 0x000000ff; } | ||
|
|
||
| /** | ||
| * Returns hue value of a 16-bit color, from 0 to 1. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function in Ops8 should operate on 8-bit colours, and the argument should be an int instead of a long.
src/com/symmetrylabs/color/Ops8.java
Outdated
| /** | ||
| * Returns the saturation of a 16-bit color, from 0 to 1. | ||
| */ | ||
| public static double saturation(long argb) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
saturation() and brightness() should take ints, not longs.
src/com/symmetrylabs/color/Ops8.java
Outdated
| /** | ||
| * Returns a color given hue, saturation, and brightness. | ||
| */ | ||
| public static long hsb(double hue, double saturation, double brightness) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hsb() and hsba() should return ints, not longs.
|
Ping covered everything I think; if you make the changes he suggested this all looks good to me. |
All values are between 0 and 1, method names are
hue,saturation,brightness,hsbandhsba.