setalpha 0.6.0 copy "setalpha: ^0.6.0" to clipboard
setalpha: ^0.6.0 copied to clipboard

outdatedDart 1 only

A convenient way to set the alpha level of css colors.

setalpha #

A library for conveniently setting the alpha level of a CSS color.

Usage #

A simple usage example:

import 'package:setalpha/setalpha.dart';

void main() {
  // CSS color "lightblue" with an alpha value of 0.5.
  String desiredResult = "rgba(173,216,230,0.5)";

  // Use a CSS color name...
  assert(setAlpha("lightblue", 0.5) == desiredResult);
  
  // Or a CSS hex value...
  assert(setAlpha("#add8e6", 0.5) == desiredResult);

  // Or a CSS hsl value...
  assert(setAlpha("hsl(195, 53%, 79%)", 0.5) == desiredResult);
  
  // Or a CSS rgb expression...
  assert(setAlpha("rgb(173,216,230)", 0.5) == desiredResult);
  
  // Or using the convenience class Color...
  assert(setAlpha(Color.lightBlue, 0.5) == desiredResult);
}

Features and bugs #

Please file feature requests and bugs at the issue tracker.

0
likes
0
pub points
0%
popularity

Publisher

unverified uploader

A convenient way to set the alpha level of css colors.

Homepage

License

unknown (LICENSE)

More

Packages that depend on setalpha