0 votes

I am hoping someone is able to guide me through how I convert pixel floating point color (e.g.0, 0, 0, 0,) to RGB value (e.g. 255.255.255) using Color8(). I have found the documentation and tried several ways to implement it, to no avail.

A tiny example would be a huge help if possible.

I am currently using get_pixelv and would like to convert it to 255 values and display that on screen. I currently have the floating points showing

Godot version 3.2.3 stable
in Engine by (22 points)
edited by

Multiply each floating number to 255.

e.g.
1.0 x 255 = 255
0.5 x 255 = 127 or 128 depending on the rounding

Also, I think Color8 has an alpha value?
Better convert that too.

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.