// a little helper to a create proper ANSI 8-bit color escape sequence
-function ansi8(string $str, int $color, bool $background = false):string{
- $color = max(0, min($color, 255));
- $background = ($background ? 48 : 38);
-
- return sprintf("\x1b[%s;5;%sm%s\x1b[0m", $background, $color, $str);
-}
-
-$options = new QROptions;
+
+QRStringText
+Class QRStringText:
+render in a CLI console, using ANSI colors and block elements.
+
+Example
+See: plaintext example
+$options = new QROptions;
$options->outputInterface = QRStringText::class;
$options->eol = "\n";
@@ -402,20 +395,6 @@
-
-JSON
-$options = new QROptions;
-
-$options->outputType = QROutputInterface::STRING_JSON;
-// output the integer values ($M_TYPE) held in the matrix object
-$options->jsonAsBooleans = false;
-
-header('Content-type: application/json');
-
-echo (new QRCode($options))->render($data);
-
-
-
Additional methods
@@ -426,23 +405,15 @@
-(protected) text() |
-string
|
-string output |
-
-(protected) json() |
-string
|
-JSON output |
-
-ansi8(string $str, int $color, bool $background = null)
|
+
ansi8(string $str, int $color, bool $background = null)
|
string
|
a little helper to create a proper ANSI 8-bit color escape sequence |
-
-Options that affect this module
+
+Options that affect this class
property |
@@ -453,65 +424,17 @@
|---|
$eol
|
string
|
-$jsonAsBooleans
|
-bool
|
-
-$textDark
|
+
$textDark
|
string
|
-$textLight
|
+
$textLight
|
string
|
-$textLineStart
|
+
$textLineStart
|
string
|
-
-Options that have no effect
-
-
-property |
-reason |
-
-
-
-$bgColor
|
-N/A |
-
-$circleRadius
|
-N/A |
-
-$connectPaths
|
-N/A |
-
-$drawCircularModules
|
-N/A |
-
-$drawLightModules
|
-not implemented |
-
-$excludeFromConnect
|
-N/A |
-
-$imageTransparent
|
-N/A |
-
-$keepAsSquare
|
-N/A |
-
-$outputBase64
|
-N/A |
-
-$returnResource
|
-N/A |
-
-$scale
|
-N/A |
-
-
-
-
@@ -519,7 +442,7 @@