CPPixel

object CPPixel

Companion object with utility functions.

Companion:
class
Source:
CPPixel.scala
trait Product
trait Mirror
class Object
trait Matchable
class Any
CPPixel.type

Type members

Inherited types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Inherited from:
Mirror
Source:
Mirror.scala
type MirroredLabel <: String

The name of the type

The name of the type

Inherited from:
Mirror
Source:
Mirror.scala

Value members

Concrete methods

def apply(char: Char, fg: CPColor): CPPixel

Creates new pixel without background and default zero tag.

Creates new pixel without background and default zero tag.

Value parameters:
char

Pixel character.

fg

Pixel foreground.

Note:

Pixel tag will be set to zero.

Source:
CPPixel.scala
def apply(char: Char, fg: CPColor, tag: Int): CPPixel

Creates new pixel without background.

Creates new pixel without background.

Value parameters:
char

Pixel character.

fg

Pixel foreground.

tag

Pixel tag.

Source:
CPPixel.scala
def apply(char: Char, fg: CPColor, bg: CPColor): CPPixel

Creates new pixel.

Creates new pixel.

Value parameters:
bg

Pixel background.

char

Pixel character.

fg

Pixel foreground.

Note:

Pixel tag will be set to zero.

Source:
CPPixel.scala
def apply(char: Char, fg: CPColor, bg: Option[CPColor]): CPPixel

Creates new pixel.

Creates new pixel.

Value parameters:
bg

Optional pixel background.

char

Pixel character.

fg

Pixel foreground.

Note:

Pixel tag will be set to zero.

Source:
CPPixel.scala
def apply(char: Char, fg: CPColor, bg: CPColor, tag: Int): CPPixel

Creates new pixel.

Creates new pixel.

Value parameters:
bg

Pixel background.

char

Pixel character.

fg

Pixel foreground.

tag

Pixel tag.

Source:
CPPixel.scala
def apply(char: Char, fg: CPColor, bg: Option[CPColor], tag: Int): CPPixel

Creates new pixel.

Creates new pixel.

Value parameters:
bg

Optional pixel background.

char

Pixel character.

fg

Pixel foreground.

tag

Pixel tag.

Source:
CPPixel.scala
def seq(first: Char, last: Char, fg: CPColor, bg: Option[CPColor]): Seq[CPPixel]

Makes a sequence of pixel from the range of characters. Range must be sequential.

Makes a sequence of pixel from the range of characters. Range must be sequential.

Value parameters:
bg

Background color.

fg

Foreground color.

first

First character in the range.

last

Last character in the range.

Note:

Pixel tag will be set to zero.

Source:
CPPixel.scala
def seq(first: Char, last: Char, fgf: Char => CPColor, bgf: Char => Option[CPColor]): Seq[CPPixel]

Makes a sequence of pixel from the range of characters. Range must be sequential.

Makes a sequence of pixel from the range of characters. Range must be sequential.

Value parameters:
bgf

Function for background color.

fgf

Function for foreground color.

first

First character in the range.

last

Last character in the range.

Note:

Pixel tag will be set to zero.

Source:
CPPixel.scala
def seq(chars: String, fg: CPColor, bg: Option[CPColor]): Seq[CPPixel]

Makes a sequence of pixel from given string.

Makes a sequence of pixel from given string.

Value parameters:
bg

Background color.

chars

Sequence of characters.

fg

Foreground color.

Note:

Pixel tag will be set to zero.

Source:
CPPixel.scala
def seq(chars: String, fgf: Char => CPColor, bgf: Char => Option[CPColor]): Seq[CPPixel]

Makes a sequence of pixel from given string.

Makes a sequence of pixel from given string.

Value parameters:
bgf

Function for background color.

chars

Sequence of characters.

fgf

Function for foreground color.

Note:

Pixel tag will be set to zero.

Source:
CPPixel.scala

Concrete fields

final val XRAY: CPPixel

Transparent non-rendering pixel. Background and foreground are unused. Note that this pixel is never rendered on any terminal. It can only be used internally for drawing on canvas, creating images, etc.

Transparent non-rendering pixel. Background and foreground are unused. Note that this pixel is never rendered on any terminal. It can only be used internally for drawing on canvas, creating images, etc.

Source:
CPPixel.scala

Givens

Givens

Extensions

Extensions

extension (ch: Char)
@targetName("mkCharFgPixel")
infix def &(c: CPColor): CPPixel

Adds '&' operator to Char type as a sugar to create pixel without background. For example:

Adds '&' operator to Char type as a sugar to create pixel without background. For example:

   val x = 'x'&C_BLACK
   val ch = 'a'
   val a = ch&C_WHITE
Source:
CPPixel.scala
@targetName("mkCharFgBgPixel")
infix def &&(fg: CPColor, bg: CPColor): CPPixel

Adds '&&' operator to Char type as a sugar to create pixel with background. For example:

Adds '&&' operator to Char type as a sugar to create pixel with background. For example:

   val x = 'x'&&(C_BLACK, C_WHITE)
   val ch = 'a'
   val a = ch&&(C_WHITE, C_PINK)
Source:
CPPixel.scala
@targetName("mkCharFgOptBgPixel")
infix def &?(fg: CPColor, bg: Option[CPColor]): CPPixel

Adds '&?' operator to Char type as a sugar to create pixel with background. For example:

Adds '&?' operator to Char type as a sugar to create pixel with background. For example:

   val x = 'x'&?(C_BLACK, Option(C_WHITE))
   val ch = 'a'
   val a = ch&?(C_WHITE, Some(C_PINK))
Source:
CPPixel.scala