RGBA doesn't match (solved)

What are the value’s of the RGBA colors,

I put some text on the screen using this code

import direct.directbase.DirectStart
from direct.gui.OnscreenText import OnscreenText 
from direct.gui.DirectGui import *
from pandac.PandaModules import TextNode

text = TextNode('tekst') 
text.setText("text on screen") 
text.setTextColor(255, 255, 255, 1)
text.setWordwrap(10.0)
text.setAlign(TextNode.ACenter)
text.setCardColor(0, 64, 128, 1) 
text.setCardAsMargin(1, 1, 1, 1)

textNodePath = aspect2d.attachNewNode(text) 
textNodePath.setScale(0.07)
textNodePath.setPos(-0.5,0,0.5)

run()

This should give some white text one a bleu frame.
but it is black on a green frame.

I see that some people use 0.1 values.

So whats up with the RGBA code??

Sorry if the question is to easy…still a newbie

Colors are in the range from 0 to 1. More generic than using 0…255, since there are other color formats that store with e.g. 7, 12 or 16 bits and not 8 (2^8=256). For example 32 bit grayscale is very popular for heightmaps.

For example to get a full red or a dark green use:

( 1.0, 0.0, 0.0, 1.0 ) # bright red
( 0.0, 0.5, 0.0, 1.0 ) # dark green

enn0x

thanks got it…

so for my bleu collor it’s

0/255, 64/255, 128/255 = 0, 0.25, 0.5