setHex method

Color setHex(
  1. int hex, [
  2. String colorSpace = SRGBColorSpace
])

Implementation

Color setHex(int hex, [String colorSpace = SRGBColorSpace]) {
  hex = Math.floor(hex);

  r = (hex >> 16 & 255) / 255;
  g = (hex >> 8 & 255) / 255;
  b = (hex & 255) / 255;

  ColorManagement.toWorkingColorSpace( this, colorSpace );

  return this;
}