Skip to content
This repository has been archived by the owner on Dec 11, 2020. It is now read-only.

Add RGBA functionality to Color Provider #653

Merged
merged 2 commits into from
Aug 24, 2015
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/Faker/Provider/Color.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,14 @@ public static function rgbCssColor()
return 'rgb(' . static::rgbColor() . ')';
}

/**
* @example 'rgba(0,255,122,0.8)'
*/
public static function rgbaCssColor()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd name it rgbaColor()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to respect the naming convention of the function "rgbCssColor". That's why I think this is the most appropriate. Don't you think so ?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right!

{
return 'rgba(' . static::rgbColor() . ',' . static::randomFloat(1, 0, 1) . ')';
}

/**
* @example 'blue'
*/
Expand Down