In a graphics rendering engine, you need to store RGB color values. Which data type would be most appropriate for each color channel to balance memory usage and color depth? 

  • float 
  • int 
  • unsigned char 
  • long
Each RGB color channel requires values from 0 to 255. An unsigned char can store values in this range using just 8 bits, making it efficient in memory usage. Using larger data types like int or float would be wasteful in terms of memory without providing additional benefits for this use case.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *