Re: Problems with colors
Thies Pfeiffer <[email protected]> Fri, 22 Jul 2005 12:11:00 +0200
| Newsgroups | gmane.comp.breve |
|---|---|
| Message-ID | <[email protected]> |
Andreas Fedrizzi schrieb: >self set-color to (0.0, opinion*25.0, 0.0). > >But for every opinion-value between 1 and 9 the green is the same. Except when the opinion is 0, then the cell turns black. >I then tested the colors by directly assigning values. It turned out that for example (10, 0, 0) and (255, 0, 0) look the same and colors like (10, 20, 255) for example are completely white. > >What am I doing wrong? > > I assume that the colour values are specified in terms of OpenGL colours. If so, the values are not to be given in RGB-bytes, but in floats or doubles in the range from 0.0f - 1.0f. That is (1.0 0 0) for red (0 1.0 0) for green (0 0 1.0) for blue Specifying larger values will result in a cut-off, so (10 0 0) => (1.0 0 0) (255 0 0) => (1.0 0 0) so this is the reason why you always get the same colour appearance. So try something like: self set-color to (0.0, opinion * (1 / 10), 0.0). Hope I could be of help, Thies -- Dipl. Inform. Thies Pfeiffer University of Bielefeld - SFB 360 - Project C3 - Room D4-123 EMail: [email protected] - Telephone: +49 521 106 5276 _______________________________________________ breve mailing list [email protected] http://lists.spiderland.org/mailman/listinfo/breve