mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-25 01:20:37 +00:00
gradient function considers 4 coordinates
This commit is contained in:
parent
09fcd14aa7
commit
d68ce01b63
@ -922,7 +922,7 @@ EX void drawmessages() {
|
||||
EX color_t gradient(color_t c0, color_t c1, ld v0, ld v, ld v1) {
|
||||
int vv = int(256 * ((v-v0) / (v1-v0)));
|
||||
color_t c = 0;
|
||||
for(int a=0; a<3; a++) {
|
||||
for(int a=0; a<4; a++) {
|
||||
int p0 = part(c0, a);
|
||||
int p1 = part(c1, a);
|
||||
part(c, a) = (p0*(256-vv) + p1*vv + 127) >> 8;
|
||||
|
Loading…
Reference in New Issue
Block a user