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

Added a Color Wheel for Harmony Color Modes #14

Merged
merged 9 commits into from
Jan 21, 2022

Conversation

riggaroo
Copy link
Collaborator

@riggaroo riggaroo commented Jan 17, 2022

Added a new kind of color wheel for getting different ColorHarmonyModes.

Usage

HarmonyColorPicker(
            harmonyMode = ColorHarmonyMode.COMPLEMENTARY,
            modifier = Modifier.size(400.dp),
            onColorChanged = { hsvColor ->
                currentColor.value = hsvColor.toColor()
           })

Screenshots

Android:
Screenshot_1642751332
Screenshot_1642751327
Screenshot_1642751323

Desktop:

Screenshot 2022-01-21 at 09 46 13

Rebecca Franks added 5 commits January 11, 2022 17:16
Properly scaling the magnifiers so they don't overlap the whole color wheel when much smaller.

Fix position of magnifiers when content size was longer than it was wide.
@riggaroo riggaroo marked this pull request as ready for review January 21, 2022 07:49
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.material.*

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit] Does your code style guide allow for wildcard imports?

Column(modifier = Modifier.fillMaxWidth()) {
Text(
modifier = Modifier.padding(16.dp),
text = "a: ${currentColor.alpha} \n" +

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit] This won't work for RTL languages

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this is just the sample app, not the library.

}
HarmonyColorPicker(
harmonyMode = harmonyMode.value,
modifier = Modifier.size(400.dp),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit] I'm not comfortable with all these* hardcoded sizes. With good old views we defined sizes in terms of available space. Is this not an option here?

  • height = 300 in the code above.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just the sample app showing how you can set the size.

@riggaroo riggaroo changed the title [WIP] Added a Color Wheel for Harmony Color Modes Added a Color Wheel for Harmony Color Modes Jan 21, 2022
@riggaroo riggaroo self-assigned this Jan 21, 2022
Comment on lines +23 to +27
Text(stringResource(R.string.classic_color_picker_sample))
},
navigationIcon = {
BackButton { navController.navigateUp() }
})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit] Something's off with the formatting here

README.md Outdated
@@ -33,13 +36,29 @@ Column {
}
```

Or Add the `HarmonyColorPicker` to your Compose hierarchy for a HSV circle color wheel implementation:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit] 'HSV circle color wheel' seems a bit redundant. I'd remove 'circle'.

README.md Outdated
})
```

The `HarmonyColorPicker` allows for you to set a certain `ColorHarmonyMode` to enable the different options to be

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit] I'd rephrase this. It's not just 'options displayed', it's a whole new feature that deserves a proper description.

README.md Outdated

### Harmony Mode

To Change the harmony mode of the picker, pass in a different mode into the function:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit] Odd capitalization of 'Change'.

@riggaroo riggaroo merged commit 9b1872f into main Jan 21, 2022
@riggaroo riggaroo deleted the feature/color-wheel-harmony branch January 21, 2022 08:41
riggaroo pushed a commit that referenced this pull request Feb 17, 2022
Added a Color Wheel for Harmony Color Modes
riggaroo pushed a commit that referenced this pull request Feb 17, 2022
Added a Color Wheel for Harmony Color Modes
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.

2 participants