class Pixie::Pixel

Defined in:

pixie/pixel.cr

Constant Summary

BLACK = Pixel.from_rgb(0, 0, 0)
BLUE = Pixel.from_rgb(0, 0, 255)
BROWN = Pixel.from_rgb(165, 42, 42)
COLOR_HEX_REGEX = /^#([A-Fa-f0-9]{9}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/
CYAN = Pixel.from_rgb(0, 255, 255)
GRAY = Pixel.from_rgb(128, 128, 128)
GREEN = Pixel.from_rgb(0, 255, 0)
MAGENTA = Pixel.from_rgb(255, 0, 255)
ORANGE = Pixel.from_rgb(255, 165, 0)
PINK = Pixel.from_rgb(255, 192, 203)
PURPLE = Pixel.from_rgb(128, 0, 128)
RED = Pixel.from_rgb(255, 0, 0)
TRANSPARENT = Pixel.from_rgb(0, 0, 0, 0)
WHITE = Pixel.from_rgb(255, 255, 255)
YELLOW = Pixel.from_rgb(255, 255, 0)

Constructors

Class Method Summary

Instance Method Summary

Macro Summary

Constructor Detail

def self.new(pixel_wand : Pointer(LibMagick::PixelWand)) #

[View source]
def self.new #

[View source]

Class Method Detail

def self.from_cmyk(cyan : Int, magenta : Int, yellow : Int, key : Int) #

[View source]
def self.from_hex(color : String) #

[View source]
def self.from_rgb(red : Int, green : Int, blue : Int, alpha : Int = 1) #

[View source]
def self.parse(string : String) #

[View source]

Instance Method Detail

def <=>(other : Pixel) #

[View source]
def ==(other : Pixel) #

[View source]
def alpha #

[View source]
def alpha=(val : Float) #

[View source]
def alpha_quantum #

[View source]
def alpha_quantum=(val : Float) #

[View source]
def black #

[View source]
def black=(val : Float) #

[View source]
def black_quantum #

[View source]
def black_quantum=(val : Float) #

[View source]
def blue #

[View source]
def blue=(val : Float) #

[View source]
def blue_quantum #

[View source]
def blue_quantum=(val : Float) #

[View source]
def clear #

[View source]
def clone #

[View source]
def cyan #

[View source]
def cyan=(val : Float) #

[View source]
def cyan_quantum #

[View source]
def cyan_quantum=(val : Float) #

[View source]
def fuzz #

[View source]
def fuzz=(val : Float) #

[View source]
def green #

[View source]
def green=(val : Float) #

[View source]
def green_quantum #

[View source]
def green_quantum=(val : Float) #

[View source]
def hsl #

[View source]
def index #

[View source]
def info #

[View source]
def inspect #
Description copied from class Object

Returns an unambiguous and information-rich string representation of this object, typically intended for developers.

This method should usually not be overridden. It delegates to #inspect(IO) which can be overridden for custom implementations.

Also see #to_s.


[View source]
def magenta #

[View source]
def magenta=(val : Float) #

[View source]
def magenta_quantum #

[View source]
def magenta_quantum=(val : Float) #

[View source]
def normalized_string #

[View source]
def quantum_packet #

[View source]
def quantum_pixel(image : Image) #

[View source]
def red #

[View source]
def red=(val : Float) #

[View source]
def red_quantum #

[View source]
def red_quantum=(val : Float) #

[View source]
def set_cmyk(cyan : Int, magenta : Int, yellow : Int, key : Int) #

[View source]
def set_color(color : String) #

[View source]
def set_hsl(hue : Int, saturation : Int, lightness : Int) #

[View source]
def set_rgb(red : Int, green : Int, blue : Int, alpha : Int | Nil = nil) #

[View source]
def similar?(other : Pixel, fuzz : Float) #

[View source]
def size #

[View source]
def to_s #
Description copied from class Object

Returns a nicely readable and concise string representation of this object, typically intended for users.

This method should usually not be overridden. It delegates to #to_s(IO) which can be overridden for custom implementations.

Also see #inspect.


[View source]
def to_unsafe : Pointer(LibMagick::PixelWand) #

[View source]
def yellow #

[View source]
def yellow=(val : Float) #

[View source]
def yellow_quantum #

[View source]
def yellow_quantum=(val : Float) #

[View source]

Macro Detail

macro finalize #

[View source]