Rgb color on OnscreenText

hi there, i’m trying to use a basic colored text, with OnscreenText, using the fg=(229, 142, 11, 1) option.
This color should be yellow-ish, but it’s white! i’ve also noticed that (0, 0, 0, 1) is black, but (1, 1, 1, 1) is white. Shouldn’t that be a really dark gray?

I wonder if you contradict yourself in your own message. The colors are set in the range 0.0 - 1.0

2 Likes

As serega says above, colours in Panda are generally specified with their component-values being in the range 0 to 1, not in the range 0 to 255.

So, indeed, (1, 1, 1, 1) is (opaque) white–as is anything with all values higher than that.

Your yellow might be something like (0.898, 0.557, 0.043, 1). (Which was found by taking the non-alpha values that you gave for yellow and dividing each by 255.)

1 Like

omg i’m sorry i actually thought that they were RGB codes :sweat_smile:, thanks!

1 Like