Black and white to RGB

Convert Black and White to RGB and vice versa. Hecho en 🇵🇷 por Radamés J. Valentín Reyes

Import

import 'package:bw_to_rgb/bw_to_rgb.dart';

Functions

Color to Black and White

Takes RGB as arguments and returns a number ranging from 0-255

int greyscale = rgbToBlackAndWhite(
  r: 30, 
  g: 238,
  b: 231,
);

Black and white to RGB

Takes a grayscale number ranging from 0-255 and converts it into RGB values. The resulting color is not exact but similar to the original.

int greyscale = rgbToBlackAndWhite(
  r: 30, 
  g: 238, 
  b: 231,
);
ConvertedRGB convertedRGB = blackAndWhiteToRGB(greyscale);

References

Libraries

bw_to_rgb