Skip to content

Commit dc5e6bc

Browse files
committed
Add RGBA functionnality to Color Provider
1 parent 55e5560 commit dc5e6bc

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Faker/Provider/Color.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,14 @@ public static function rgbCssColor()
9090
return 'rgb(' . static::rgbColor() . ')';
9191
}
9292

93+
/**
94+
* @example 'rgba(0,255,122,0.8)'
95+
*/
96+
public static function rgbaCssColor()
97+
{
98+
return 'rgba(' . static::rgbColor() . ',' . static::randomFloat(1, 0, 1) . ')';
99+
}
100+
93101
/**
94102
* @example 'blue'
95103
*/

0 commit comments

Comments
 (0)