MATLAB: What is the decimal RGB scale used in Matlab called

colorcolourfiguresgraphsplotsrgb

Hi there,
I have been trying lots of websites to find colours for my plots. The colours i find on webistes that are RGB are ont on the decimal scale. Therefore is there another scale I should search for, or is there a way to convert them?
Example:
  • RGB: (37, 147, 174)
Many thanks!

Best Answer

As Rik Wisselink mentioned, RGB values are scaled to 0-255 (8 bit means 2^8 which equal 256). Matlab normalizes each RGB value to this 256 range. So a value of 0.5 means 50% of the 256 range.
For example, the color crimson is represented as [0.85938 0.078125 0.23438]. When you multiply this by 256,
[0.85938 0.078125 0.23438] * 256
ans =
[ 220 20 60]
Likewise, if you have an RBG value of [0, 250, 100], matlab will represent it as
[0, 250, 100] / 256
ans =
[ 0 0.97656 0.39063]
[UPDATE]
Scaling by 255 makes more sense than by 256 for reasons explained in the comment section below.