Although sepia is sometimes defined as having a hue at 30° on the HSV color wheel, when applied as a CSS filter the result can vary anywhere from 30° to 60° depending on the input color.
However, in practice I've found that if you assume a hue of around 50° it works pretty well for faking a tint.
To do this, you first convert your input color from hex to HSV using something like this: How do you get the hue of a #xxxxxx colour?
Then, find the difference between the target hue and 50°. For instance, if the target is 210° blue, the difference is 210 - 50 = -160
.
Then use that difference as a hue-rotate
value in your filter list, after first converting to sepia:
filter: sepia(1) hue-rotate(-160deg)
Or, you can could use a calc
and update the filter value inline, with something like:
filter: sepia(1) hue-rotate(calc(210deg - 50deg))
(Note: You may need to adjust saturate
or contrast
to get the effect you want.)
(Also: make sure the version of React you are using supports css filters.)