Products such as bags or make-up can cause big issues without a color attribute. This is required for:
Given this business requirement, I was thinking to create a new attribute type called Color attribute type, that basically extends Text Attribute, but the form used in product editing page is having a color picker that fills in the Text field with the HEX code.
In front-end, given the attribute type is color, the UI Developer will know to render it accordingly.
How have you tackled this so far?
IMO there should be description of a color along with the colorpicker. Like Bright Red and so on.
Makes it easer from UX standpoint.
so, in your opinion, it should be something like an multi-level assoc array: [ "color" => [ "key" = "#ffffff", "value" = "white" ] ] ?
and white should either be manually completed by the operator or completed by referring to something from like CSS color names?
I think there should be one more field to describe the color. Something like color_hex and color_text. Altthough i haven't dived into new attribute system yet so i'm not sure which way would be easier to implement. But you get the idea :)
Color description should be written by hand and shouldn't know anything about CSS. Because there are plenty of examples where manufactures prefer to name colors in their unique way like Rose Gold and Glossy White.
Also even tho i think it's definitely good to have visual representation of color i'm not sure about colorpicking approach. It might add a tons of headache for your CM stuff.
Personally i don't see a living being colorpicking every single product lol.
Personally i don't see a living being colorpicking every single product lol.
I think the same thing. I never saw color description based on a colorpicker on any shop I know. Might add overrhead.
If there is an approach like [ "color" => [ "key" = "#ffffff", "value" = "white" ] ]
My concerns:
I thought in default Sylius that Color was more suited to being an option than an attribute?
@peteward and this leads us to the question of "Why dont we introduce option types like we did for attributes". So we can render different visual depending on type.
WDYT?
@peteward it's good you opened this discussion up, because after clarifying color attribute, my plan was to open another RFC about color option.
in my context, we don't have yet product variations - we have only masterVariants. this feature is scheduled on our roadmap for next month. that's why I'm talking about the attribute type right now.
why I think we need a color picker is because we need to show in frontend something like this:




Sure, it would be nice to have, on top of the color picker:
But all these are in the "Nice to have" section of the backlog.
First and foremost, we need:
In terms of admin interface, we need something like this: https://www.script-tutorials.com/demos/158/index.html
Hope you understand the need better now. What do you think?
We actually went down a different route and created Colours and Sizes as their own entities, partly because of the problem you are facing but also because our business is quite narrow scope of clothes and we have core and sometimes complex business logic associated with them:
However I agree with your principle here that there needs to be a way to extend or decorate Attributes or Options to provide this functionality in a more general way, and it's probably not that difficult, it just needs a solid proposal.
My MVP proposal for this is:
Admin wireframe:



WDYT?
@pjedrzejewski should we think about this as a potential pull request to core or should we think about it as a custom userland implementation?
@peteward I've seen a system where colors have a parent-child relation; there is the color "Red" with a lot of children like "Sweet red", "Foxy red" etc. and each children entity has the following attributes:
And filters are created on top of the parent color, while in product page the child color is used for reference.
The idea is not bad, but I find it very complicated and a bit too much for some simpler use-cases.
hmmm...
The problem here is that you now don't support a name for the colour, only it's hex value. Some people will prefer (or require) different ways of representing something. The colour picker idea is interesting, but it's not the only way to represent a colour.
I think the more fundamental point here is attributes or options that have multiple defining characteristics. In the case of colour it could be Name + Hex or Name + Swatch Image.
Then if you assign the colour 'Red' as your products Attribute, it will inherit all details about 'Red', including it's Hex value. This gives you control in one place so if you wanted to change how red looks, you only change it once, not across 200 products.
@peteward interesting point of view. I fully agree with it. That would mean we have the following types of color attributes:
Is there something generic I'm missing here?
This might help, let's say, it proposes the most X color used in your product picture and it propose to use 1-N of those color as attributes ? Could be a smooth workflow there :
https://github.com/thephpleague/color-extractor
(For hex colors only, because I'm +1 with the need of having hex colors / name colors and swatch colors)
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in a week if no further activity occurs. Thank you for your contributions.
Most helpful comment
I think the same thing. I never saw color description based on a colorpicker on any shop I know. Might add overrhead.
If there is an approach like
[ "color" => [ "key" = "#ffffff", "value" = "white" ] ]My concerns: