Convert a hue color in a other hue color?
I tried to convert a hue color in a other hue color, but dont know the math solution for it and the convert rgb to hsv vector only returns values 0 - 1 and the default node in ue4 only accepts values -1 - +1. Can please anyone help me?
If I understand the question correctly, you're just looking for a way to convert a value that falls in the range [0,1] to an "equivalent" value in the range [-1,1].
If that's the case, it's not too bad! Simply double your initial value (putting it into the range [0,2]), and then subtract 1.
This is a bit of a simplification of the general way to do this, which involves normalizing the value and then converting it to the new range. That looks something like this:
Where "a" is the original range (bounded by aMax and aMin and containing your original value, vA) and "b" is the target range (bounded by bMax and bMin and containing the value you're trying to get, vB).
The first part of the equation basically figures out how far along you are in the original range. It does this by subtracting the first range's offset from zero, then dividing by the size of that range. This basically gives you a "percent" to work with. That value gets multiplied by how big the target range is, and offset by the new range's offset.
Hope that helps!
answered Apr 26 '19 at 07:47 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here