Closed DmitrySharabin closed 3 weeks ago
Name | Link |
---|---|
Latest commit | 42ae461e5d7ecb647eaece3b87c901553a2ca796 |
Latest deploy log | https://app.netlify.com/sites/color-elements/deploys/6729f4419f15120008fb1c19 |
Deploy Preview | https://deploy-preview-143--color-elements.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Thank you so much for your review! Every comment is on point, and I'll try to address it ASAP.
@LeaVerou, I addressed all your feedback (thank you for it). Here are the changes I made:
value
for actual input (as a string) and selectedSpace
for the corresponding space objectgroups()
prop{ id, name: id }
objectsvaluechange
and spacechange
eventsinput
eventformAssociated
, use change
as the changeEvent
Here is an example of using a custom grouping (from your color palettes research):
<space-picker id="space_picker" spaces="oklch, p3, srgb" value = "p3"></space-picker>
<script type="module">
space_picker.groups = (spaces) => {
let ret = {polar: {}, rectangular: {}};
for (let id in spaces) {
let space = spaces[id];
if (space.id !== id) {
continue;
}
let isPolar = space.coords.h?.type === "angle";
ret[isPolar ? "polar" : "rectangular"][id] = space;
}
return ret;
};
</script>
Could you please take a look at this PR one more time?
Thank you so much for your feedback! I tried to address all the issues you pointed out. Namely:
groupBy()
prop that expects a space and returns the name of a group the space belongs toProviding grouping looks like so now:
<space-picker id="space_picker" spaces="oklch, p3, srgb" value = "p3"></space-picker>
<script type="module">
space_picker.groupBy = (space) => {
let isPolar = space.coords.h?.type === "angle";
return isPolar? "Polar" : "Rectangular";
};
</script>
groups
is now a computed prop returning an object with all the groupsI hope I got everything right. If not, I'll be happy to fix it.
Looks good! Please add a README, and add it to the list of upcoming components.
Thank you! Will do.
Done! It's alive and can be played with: https://elements.colorjs.io/src/space-picker/ 🎉
Partially addresses #123.
Usage examples