Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F2752232
Alpha.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
Alpha.php
View Options
<?php
declare
(
strict_types
=
1
);
namespace
BaconQrCode\Renderer\Color
;
use
BaconQrCode\Exception
;
final
class
Alpha
implements
ColorInterface
{
/**
* @var int
*/
private
$alpha
;
/**
* @var ColorInterface
*/
private
$baseColor
;
/**
* @param int $alpha the alpha value, 0 to 100
*/
public
function
__construct
(
int
$alpha
,
ColorInterface
$baseColor
)
{
if
(
$alpha
<
0
||
$alpha
>
100
)
{
throw
new
Exception\InvalidArgumentException
(
'Alpha must be between 0 and 100'
);
}
$this
->
alpha
=
$alpha
;
$this
->
baseColor
=
$baseColor
;
}
public
function
getAlpha
()
:
int
{
return
$this
->
alpha
;
}
public
function
getBaseColor
()
:
ColorInterface
{
return
$this
->
baseColor
;
}
public
function
toRgb
()
:
Rgb
{
return
$this
->
baseColor
->
toRgb
();
}
public
function
toCmyk
()
:
Cmyk
{
return
$this
->
baseColor
->
toCmyk
();
}
public
function
toGray
()
:
Gray
{
return
$this
->
baseColor
->
toGray
();
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, Jul 3, 19:45 (1 d, 3 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
6d/e3/670f4118232718a6c9299332582e
Default Alt Text
Alpha.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment