Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - pm123

Pages: [1]
1
Graphics / Re: sf::Color multiplication not working
« on: July 27, 2020, 07:05:21 pm »
Ah ok, I though taking modulo 256 would make something range 0->255 but I guess that's not the standard.
So when multiplying I actually want my decr to be 255 and not 1.

2
Graphics / Re: sf::Color multiplication not working
« on: July 27, 2020, 04:32:44 pm »
dec1: 0 0 1
icolor: 80 80 80
mult: 0 0 0

mult=dec1*icolor produces zeroes instead of 0,0,80

3
Graphics / Re: sf::Color multiplication not working
« on: July 27, 2020, 01:13:57 pm »
Yes, thats what I ended up doing. But the docs say it should work. Also had to watch out for subtracting the transparency value.

4
Graphics / sf::Color multiplication not working
« on: July 26, 2020, 08:56:02 pm »
i: 80
start: 255 0 255
dec1: 0 0 1
icolor: 80 80 80
mult: 0 0 0
answer: 255 0 255

    sf::Color icolor(i,i,i);
    cout << "i: " << i << endl;
    cout << "start:"<< " " << static_cast<int>(map.start.r) << " " << static_cast<int>(map.start.g) << " " << static_cast<int>(map.start.b) << endl;
    cout << "dec1:"<< " " << static_cast<int>(map.decrement1.r) << " " << static_cast<int>(map.decrement1.g) << " " << static_cast<int>(map.decrement1.b) << endl;
    cout << "icolor:"<< " " << static_cast<int>(icolor.r) << " " << static_cast<int>(icolor.g) << " " << static_cast<int>(icolor.b) << endl;
    sf::Color mult = icolor*map.decrement1;
    cout << "mult:"<< " " << static_cast<int>(mult.r) << " " << static_cast<int>(mult.g) << " " << static_cast<int>(mult.b) << endl;
    sf::Color answer = map.start - icolor*map.decrement1;
    cout << "answer:"<< " " << static_cast<int>(answer.r) << " " << static_cast<int>(answer.g) << " " << static_cast<int>(answer.b) << endl;

Pages: [1]