Ambiloquous
Graphic Fanatic
- Group
Coloured Tabs (Or Any Static Colour Element)
This one will make any images in your tabs look just slightly off-colour (the people I've used it around haven't noticed anything though), depending on the image and the degree of rotation. The reason for this is , so it's not great for this sort of thing, but we'll take what we have. This is a hack, don't ask for perfection.(If you haven't noticed, I've used this hack on the link in the text above. In fact, I use it on basically all my links.)
- Wrap a [div]tag around the tabs with the hue-rotate filter set to a degreefilter: hue-rotate(#deg);where # is a degree from 0 to 360. Radians (rad), gradians (grad) or turns (turn) can be used as well, but I prefer degree for its precision without need for decimals. Play around with with the values to see what colours come up.
- For each [tab]body, wrap everything inside with a div with a filter property with the hue-rotate set to the "opposite" of the outside tag[div=filter: hue-rotate(-#deg);], or in other words, the negative degree of what you set the tab colour to. Otherwise, the colours inside will also be "rotated" to another colour. For instance, if I didn't wrap the second tab body with the negative degree, the orange in the image would be blue.
- Hello, world.
- I am an orange.
[div=filter: hue-rotate(160deg);][tabs]
[tab=Without Image][div=filter: hue-rotate(-160deg);]Hello, world.[/div][/tab]
[tab=With Image][div=filter: hue-rotate(-160deg);]I am an orange. [heightRestrict=200][img]https://cdn.pixabay.com/photo/2016/10/07/13/36/tangerines-1721590_1280.jpg[/img][/heightRestrict][/div][/tab]
[/tabs][/div]
- If that's all you need, you can stop right here. Otherwise, if you want to get closer to the exact shade of a colour, you can add additional filters to try and finagle your way into that perfect shade. Here's a that can be used in tandem with hue-rotate, though be careful, some of them can't be "reverted" in tab body (e.g., sepia, grayscale).
The example below uses a[div]tag withfilter: hue-rotate(160deg) saturate(200%) brightness(160%);to wrap all tabs andfilter: hue-rotate(-160deg) saturate(50%) brightness(62.5%);to wrap the contents of the tab bodies. As you can see, there is no negative percentage of saturation or brightness, so I had do some math. If you don't want to use your brain, the formula for "reverting" a percentage value is (100/percentage)*100. If you haven't noticed, the orange image is actually duller in the second example compared to the first, so this is even less of an exact reversion.
- Hello, world.
- I am an orange.
[div=filter: hue-rotate(160deg) saturate(200%) brightness(160%);][tabs]
[tab=Without Image][div=filter: hue-rotate(-160deg) saturate(50%) brightness(62.5%);]Hello, world.[/div][/tab]
[tab=With Image][div=filter: hue-rotate(-160deg) saturate(50%) brightness(62.5%);]I am an orange. [heightRestrict=200][img]https://cdn.pixabay.com/photo/2016/10/07/13/36/tangerines-1721590_1280.jpg[/img][/heightRestrict][/div][/tab]
[/tabs][/div]
Last edited: