class Sheen::Renderer

Overview

Terminal renderer holding the color profile and background darkness used to resolve and downsample colors at render time. Inspired by lipglossv1's Renderer.

Defined in:

sheen/renderer.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(output : IO = STDOUT, input : IO = STDIN, env : Foundation::Env = Foundation::LiveEnv.new) #

[View source]

Instance Method Detail

def color_profile : Foundation::Profile #

The color profile, detected from @output on first use, if not already set explicitly.


[View source]
def color_profile=(profile : Foundation::Profile) : Foundation::Profile #

Bypasses detection and sets the color profile explicitly, primarily used for testing


[View source]
def env : Foundation::Env #

[View source]
def env=(env : Foundation::Env) #

[View source]
def has_dark_background=(value : Bool) : Bool #

Forces background darkness value to value


[View source]
def has_dark_background? : Bool #

Detects if the terminal background is dark, caching the result on first read.

An explicit #has_dark_background= always wins over implicit detection.


[View source]
def input : IO #

[View source]
def input=(input : IO) #

[View source]
def output : IO #

The output the profile is detected from and that rendering targets.


[View source]
def output=(output : IO) #

The output the profile is detected from and that rendering targets.


[View source]