A
A
Alexey Lebedev2013-02-28 23:35:40
Programming
Alexey Lebedev, 2013-02-28 23:35:40

Shift to any shade

In general, such a task. I've been thinking for 2 days now.

There is a drawing in vector format. Suppose sinebely:
# 94723f
# d6ae84
# cea47a
# e1ba8e
# 96764c
# e2b697
# c19a6d
# c19a6d
# a07b5f
# b79161
# bc8e6f
# a27357
# dcb88f
# 8d6c4d
# c79c76
# 5c3e2f
# 997551
# 503626
# a67962
# cea778
# dab68c
# e0ae8c
# bd9071
# ac885a
#aa7c63
#f1cca3
#864c3f
#b79264
#b79264
#886952
#deb78a

Here is the color list.

You need to convert this picture to a red tint:
I.e. dark blue turns into dark red, blue into pink, etc.

Likewise for other colors. I think someone has already done this. Interested in source code or algorithm. I'm just really bad with flowers.

I would be grateful for an answer.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
F
fr33z3, 2013-02-28
@swanrnd

Everything is bad with colors, too, but why not translate it into HSL and play around with the values, realizing what you need?

N
numitus, 2013-03-01
@numitus

You can try tweaking the red channel. For example. red=(255+red)/2

P
PaulZi, 2013-03-01
@PaulZi

The most correct thing, of course, is to convert to HSL, and change the Hue value (it’s even called “color shade”).
Formulas can be found here on Wikipedia .

T
TheMengzor, 2013-03-03
@TheMengzor

If Javascript, then use the RGB to HSL conversion function - mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript
And then shift the HSL Hue channel to the desired value, and then convert HSL back to RGB.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question