class

CrImage::Draw::Pattern

Inherits Reference / Object

Constructors

crosshatch(color : Color::Color, spacing : Int32 = 8, thickness : Int32 = 1) : Pattern
Source
diagonal(color : Color::Color, spacing : Int32 = 8, thickness : Int32 = 2) : Pattern
Source
dots(color : Color::Color, spacing : Int32 = 8, size : Int32 = 2) : Pattern
Source
horizontal(color : Color::Color, spacing : Int32 = 6, thickness : Int32 = 2) : Pattern

Preset patterns for common use cases

Source
new(type : CrImage::Draw::PatternType = PatternType::Solid, color : CrImage::Color::Color = Color::BLACK, background : CrImage::Color::Color | Nil = nil, spacing : Int32 = 8, thickness : Int32 = 1)
Source
vertical(color : Color::Color, spacing : Int32 = 6, thickness : Int32 = 2) : Pattern
Source

Instance methods

background
Source
background=(background : Color::Color | Nil)
Source
color
Source
color=(color : Color::Color)
Source
fill_at?(x : Int32, y : Int32) : Bool

Check if a pixel should be filled based on pattern

Source
spacing
Source
spacing=(spacing : Int32)
Source
thickness
Source
thickness=(thickness : Int32)
Source
type
Source
type=(type : PatternType)
Source