Mimi Kal
Mimi Kal

Reputation: 39

How do you convert an int byte colour value (0-255) into a float / double value (0-1) in C#?

It says how to convert float color values into byte color values everywhere, I want to know how to do the opposite, anyone please help me?

Upvotes: 2

Views: 2195

Answers (1)

Marcin Iwanowski
Marcin Iwanowski

Reputation: 791

You have to divide byte value by 255.

double d = (double)byteValue / 255

Upvotes: 2

Related Questions