From 5012cb44a3e83f3072f6738db4c99ce771a8b754 Mon Sep 17 00:00:00 2001 From: JT <547158+jntrnr@users.noreply.github.com> Date: Wed, 9 Mar 2022 12:54:02 -0500 Subject: [PATCH] Fix 256 colour example (#175) * Fix 256 colour example * Fix 256 colour example --- coloring/256_color_testpattern.nu | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/coloring/256_color_testpattern.nu b/coloring/256_color_testpattern.nu index f8cbd5a..8d6887d 100644 --- a/coloring/256_color_testpattern.nu +++ b/coloring/256_color_testpattern.nu @@ -20,12 +20,6 @@ def contrast_colour [ colour:int ] { let g = (($colour - 16) mod 36) / 6 let b = ($colour - 16) mod 6 - # if $g > 2 { - # 0 - # } { - # 15 - # } - let luminance = ($r * 299) + ($g * 587) + ($b * 114) if $luminance > 2500 { 0 @@ -65,11 +59,11 @@ def print_blocks [start:int, end:int, block-cols:int, block-rows:int, blocks-per print_run ($start + $block * $block-length + $row * $block-cols + $i * $block-length * $blocks-per-line) $block-cols } | append (char nl) | str collect } | str collect - # char nl } | str collect } print_run 0 16 # The first 16 colours are spread over the whole spectrum -char nl -print_blocks 16 231 6 6 3 # 6x6x6 colour cube between 16 and 231 inclusive +print "" # Single line +print_blocks 16 123 6 6 3 # 6x6x6 colour cube between 16 and 123 inclusive +print_blocks 124 231 6 6 3 # 6x6x6 colour cube between 124 and 231 inclusive print_blocks 232 255 12 2 1 # Not 50, but 24 Shades of Grey \ No newline at end of file