-
Notifications
You must be signed in to change notification settings - Fork 126
Explore Custom Colors #116
Comments
@kevinwhoffman was looking into a way for having these custom colors showing within TinyMCE which would be awesome. Ref: https://make.wordpress.org/core/2016/08/17/wordpress-4-7-whats-on-your-mind/#comment-30869 |
Thanks for the mention @josephfusco. I would be happy to incorporate TinyMCE styling to match the customizer. I worked with @mathetos on the Twenty Sixteen proof of concept you see above, but it can be adapted to work with any theme that stores customizer settings as theme_mods. @celloexpressions I agree that for an image-heavy theme, a few color schemes would go a long way in terms of customization. |
I have completed an initial analysis of the theme's style.css file for color patterns. The results are in this gist: https://gist.github.com/celloexpressions/64e69ae9f6b5a47d97f77d230d0e7967. The first file there contains a direct reduction of style.css, removing all non-color properties. The second file combines all selectors for each property and sorts them by color, dark to light; this would be the basis for a colors template. Here is a list of the colors used:
Looking at how infrequently a could of these are used, I think a few could be combined. @melchoyce can you look through these? We also need to address some cases where there is inadequate color contrast in the base scheme, most notably with the social icons being #bbb on #fff right now. The next step is to identify colors and groups of colors that could be made into options. A few ideas I have initially:
For any of those, we would generate colors by lightening/darkening the selected color proportionally to the amount of contrast difference with the base theme colors, to maintain the same hierarchy between colors. Since everything is gray by default, there doesn't seem to be a lot of room for adjusting these while maintaining color contrast, but introducing color will open up numerous possibilities there. |
Consolidated the extraneous colors in #139 to get down to my original nine style guide colors. I'll take a look at the rest tomorrow. |
Thanks, that helps clarify the intent. A few more (mutually exclusive) ideas:
If we go the user-selected route, the key decisions are which colors to group together, which color in each group is selected with the rest being generated, and what color contrast restrictions are imposed. |
This is an appealing option.
What are you thinking re: accent color? Worse comes to worse, we could go Twenty Sixteen's route and do a light (default) and dark (inverted), with a couple monochromatic schemes generated like the first option, but we curate the colors used.
Slightly less appealing than the first option IMO, just because color schemes are hard and giving people lots of color options doesn't always result in great color schemes. |
Since the theme is strictly monochromatic out of the box, it would be interesting to try that approach and see how it works. The accent color would probably be used for secondary elements and things that currently use middle-gray colors, like #767676 and #bbb. I haven't looked closely at where each color is used. If it is more on the user-selected side, I'd definitely lean toward fewer options, potentially only letting them change accent and background, for example, and generating the rest. This route or monochromatic still give users more control/customization than presets, while ensuring that the theme looks good regardless of their choices. |
|
What about three radio buttons: Color Scheme
Where custom color shows a hue picker that applies the custom selection monochromatically? That seems like the best approach for this theme, assuming that we can get a hue-based monochromatic option working well. The light/dark options also work around the fact that you couldn't select those with a hue picker. |
I'm up for trying that 👍 |
Awesome, I'll take a first stab at it tomorrow. If anyone has technical suggestions for mapping a user-selected hue to a particular shade, let me know. I'm currently thinking that using |
There are three selectors that are the only instances of colors still:
Should those be standardized to |
Yeah, that would be great. |
Perfect, I'll take care of it in my coming PR for testing (I actually just got to the |
#167 has a first pass of an implementation of this. Here's a screencast: I think this works quite nicely. The implementation is very straightforward, even with instalt live preview in the customizer. By preserving the exact color hierarchy of the theme and only changing hue, we can ensure that the original design intent is maintained and avoid implying things with color. Color contrast is good for most hues, although it can have issues for a few. This is because the current approach uses lightness, which diverges from relative luminance (which is used to calculate color contrast). We could introduce corrections for that, but it's not bad, The saturation is arbitrary and filterable. If needed, we could adjust it for certain colors/selectors The dark scheme runs from a separate stylesheet. Right now it inverts all of the colors directly (I did it in my head quickly, so a few may be a bit off), but we can design this out. I'd suggest going lighter in general rather than all the way against |
Oh, and the hue picker is currently a slider, if we decide to proceed with this we'll build out a hue picker control. |
Here are some thoughts on it so far after testing locally.
|
@josephfusco yeah, I forgot to say that as well, but the hue picker will show only when custom is selected, and the dark scheme needs to be designed out rather than being a straight inversion. I'd like to eliminate the header text color option, unless we feel it's critical to be able to change that over a video/image. In most cases something like a shadow would be needed to ensure it's always readable anyway. But I haven't touched that yet here since it's separate. |
Cool, I wanted make sure we want to go with this approach before implementing a hue slider that shows when "custom" is selected, since that'll be a bit more work. We should consider moving that custom control into core when the theme is merged. I'll put that on my todo list. @melchoyce can you design out the dark scheme in the meantime? Essentially a matter of selecting the dark scheme equivalent for each color. |
Iris doesn't seem to support a hue-only option currently, but it shouldn't be too difficult to add. We'd want that to work with numerical hues (0-359 degrees), but all of the UI is there and just needs to be separated out from the full color picker layout. This piece will require a core patch for the Iris color picker, wpColorPicker, and WP_Customize_Color_Control, which would all add a mode called The hue picker is definitely doable in 4.7, but better committed after the theme is merged into core. Can we clean up the dark color scheme, then merge this into the theme as a slider, with the addition of a description indicating that it'll become a hue picker after core merge? If we wait, it'll be much more difficult to keep the color files synced with style.css, and we'd also lose out on a lot of testing for the functional parts here. |
Radio feels better to me since there are only a few options, and requires fewer clicks/taps. Twenty Eleven takes this approach if we look all the way back to that, but Fifteen and Sixteen use select plus several (too many) individual color pickers. I think they're equally appropriate in terms of accessibility. |
@celloexpressions Nice work on the demo. One concern I have in regards to automating the color scheme is that many users will begin their site with their brand colors already defined. As a business owner, I want the ability to specifically set the hex value for the background color of the header. I understand the merits of the automated approach. It prevents the uninformed designer from going off the rails. It generally ensures contrast is maintained for accessibility purposes. It is technically impressive. All good stuff. However, it also takes a great deal of control away from the user or designer who does have a specific color scheme in mind. In that regard I feel this is a step backwards from Twenty Sixteen. I'm wondering if the following would be possible...
With this approach, we can still provide a great starting point for users with a custom color scheme, but they have control. I don't feel like this is one of those "decisions not options" scenarios. We're talking about the visual identity of the site—the outward projection of the user's identity. They should have control over it even if the theme guides them along the way. |
Not directly, but I can probably be convinced to introduced a hue slider-only mode. It wouldn't really make sense to use something else to me. |
Here's what I'm thinking for a dark scheme:
...With the exception of the header text, which should stay the same on the homepage (but change on interior pages). That looks like this: |
Looks good, I've updated the PR accordingly for the dark color scheme. This should be ready to merge, then the hue picker can be implemented once core adds it in https://core.trac.wordpress.org/ticket/38263. @mattwiebe do you have time to work on the core/Iris part? I'm not familiar with the internals of Iris. |
For reference, #167 is where the colors are at currently. Overall, I like where the colors are. This should give users some choices and eliminate the need for many schemes. I do think that with most color choices don't look as good as the default scheme or dark scheme. It just doesn't have the same punch. It's fun to play with the slider. Its accessibility isn't bad, and I hope the hue picker is solid too. I noticed a few inconsistencies: Scroll down button: https://cloudup.com/cyLE98qc0OS I'm cool with moving forward on this, but leave the final call to @melchoyce since this is design related. |
I lightened the dark scheme colors, removed the inverted gradient, and fixed in inversion of inputs. In terms of saturation, you can test by changing the number where it's defined at the top of For the bugs brought up, as I mentioned previously we need to re-sync everything that's changed in |
Yeah, that's what I was editing when I came up with 40%. IMO, the body text is the biggest reason to decrease to 40% — it feels much too saturated higher than that. If we could decrease the saturation on the body text and on the borders, I'd be happy to leave the others around 50%. Inputs look good. 👍
Cool — @davidakennedy how do you feel about getting this in as-is and iterating in new PRs? |
Added a quick commit to adjust saturation and reduce it further on |
Add custom colors to Twenty Seventeen. Resolves #116.
Once the design is implemented (#4), I'd like to explore potential custom color options. A lot of sites will be using this theme, and for sites that have less image content, custom colors would offer a way to skin the theme to convey a unique identity that would otherwise come largely from images.
I'd like to start by analyzing the completed stylesheet and all colors used. From there, we would look at what might make sense to be customizable, and which colors could be automatically set or generated based on user selections. @melchoyce could guide the ways that this dynamic design element can control the look and feel of the theme.
This is how the Fourteen Colors plugin, which started out as part of the Twenty Fourteen theme works. We'd leverage this technique to get instant live previews. This approach for custom colors works best when there are 1-3 user-selected colors, and everything else is handled automatically. We can also integrate with the customize notifications API to warn users when there is insufficient contrast in their selections, where applicable.
The text was updated successfully, but these errors were encountered: