@@ -52,11 +52,7 @@ protected function collectModules(Closure $transform):array{
52
52
&& !$ this ->matrix ->checkTypeIn ($ x , $ y , $ this ->options ->excludeFromConnect )
53
53
){
54
54
// to connect paths we'll redeclare the $M_TYPE_LAYER to data only
55
- $ M_TYPE_LAYER = QRMatrix::M_DATA ;
56
-
57
- if ($ this ->matrix ->check ($ x , $ y )){
58
- $ M_TYPE_LAYER = QRMatrix::M_DATA_DARK ;
59
- }
55
+ $ M_TYPE_LAYER = $ this ->matrix ->check ($ x , $ y ) ? QRMatrix::M_DATA_DARK : QRMatrix::M_DATA ;
60
56
}
61
57
62
58
// randomly assign another $M_TYPE_LAYER for the given types
@@ -104,13 +100,14 @@ class RandomDotsOptions extends QROptions{
104
100
$ options = new RandomDotsOptions ;
105
101
106
102
// our custom dot colors
103
+ // adding the IS_DARK flag so that the proper layer css class is assigned
107
104
$ options ->dotColors = [
108
- 111 => '#e2453c ' ,
109
- 222 => '#e07e39 ' ,
110
- 333 => '#e5d667 ' ,
111
- 444 => '#51b95b ' ,
112
- 555 => '#1e72b7 ' ,
113
- 666 => '#6f5ba7 ' ,
105
+ ( 111 | QRMatrix:: IS_DARK ) => '#e2453c ' ,
106
+ ( 222 | QRMatrix:: IS_DARK ) => '#e07e39 ' ,
107
+ ( 333 | QRMatrix:: IS_DARK ) => '#e5d667 ' ,
108
+ ( 444 | QRMatrix:: IS_DARK ) => '#51b95b ' ,
109
+ ( 555 | QRMatrix:: IS_DARK ) => '#1e72b7 ' ,
110
+ ( 666 | QRMatrix:: IS_DARK ) => '#6f5ba7 ' ,
114
111
];
115
112
116
113
// generate the CSS for the several colored layers
@@ -122,7 +119,6 @@ class RandomDotsOptions extends QROptions{
122
119
123
120
$ options ->svgDefs = '
124
121
<style><![CDATA[
125
- .light{ fill: #dedede; }
126
122
.dark{ fill: #424242; }
127
123
' .$ layerColors .'
128
124
]]></style> ' ;
0 commit comments