Skip to content

Conversation

@hdanak
Copy link
Collaborator

@hdanak hdanak commented Sep 19, 2018

All values are between 0 and 1, method names are hue, saturation, brightness, hsb and hsba.

@hdanak hdanak requested review from haldean and zestyping September 19, 2018 01:35
* Returns a color given hue, saturation, brightness, and alpha.
*/
public static long hsba(double hue, double saturation, double brightness, double alpha) {
hue = hue * 360;
Copy link
Collaborator

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.

public static int blue(int argb) { return argb & 0x000000ff; }

/**
* Returns hue value of a 16-bit color, from 0 to 1.
Copy link
Collaborator

@zestyping zestyping Sep 19, 2018

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.

/**
* Returns the saturation of a 16-bit color, from 0 to 1.
*/
public static double saturation(long argb) {
Copy link
Collaborator

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.

/**
* Returns a color given hue, saturation, and brightness.
*/
public static long hsb(double hue, double saturation, double brightness) {
Copy link
Collaborator

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.

@haldean
Copy link
Contributor

haldean commented Sep 19, 2018

Ping covered everything I think; if you make the changes he suggested this all looks good to me.

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.

4 participants