Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4119351
Color.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
Color.php
View Options
<?php
declare
(
strict_types
=
1
);
namespace
Endroid\QrCode\Color
;
final
class
Color
implements
ColorInterface
{
private
int
$red
;
private
int
$green
;
private
int
$blue
;
private
int
$alpha
;
public
function
__construct
(
int
$red
,
int
$green
,
int
$blue
,
int
$alpha
=
0
)
{
$this
->
red
=
$red
;
$this
->
green
=
$green
;
$this
->
blue
=
$blue
;
$this
->
alpha
=
$alpha
;
}
public
function
getRed
():
int
{
return
$this
->
red
;
}
public
function
getGreen
():
int
{
return
$this
->
green
;
}
public
function
getBlue
():
int
{
return
$this
->
blue
;
}
public
function
getAlpha
():
int
{
return
$this
->
alpha
;
}
public
function
getOpacity
():
float
{
return
1
-
$this
->
alpha
/
127
;
}
public
function
getHex
():
string
{
return
sprintf
(
'#%02x%02x%02x'
,
$this
->
red
,
$this
->
green
,
$this
->
blue
);
}
public
function
toArray
():
array
{
return
[
'red'
=>
$this
->
red
,
'green'
=>
$this
->
green
,
'blue'
=>
$this
->
blue
,
'alpha'
=>
$this
->
alpha
,
];
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Wed, Aug 19, 03:18 (2 w, 19 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
1c/23/fa9024c49b9bc73a83697601d490
Default Alt Text
Color.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment