intToBinary method

String intToBinary(
  1. int pixel
)

Implementation

String intToBinary(int pixel) {
  String binary = pixel.toRadixString(2);
  while (binary.length < 8) {
    binary = "0" + binary;
  }
  return binary;
}