Pixel

public struct Pixel : CustomStringConvertible

Represents the color intensities for one pixel in a Photo.

Abstract State:

  • red, green, and blue channels
  • each is a value between 0..255

This is an immutable struct.

  • red

    The intensity of red in the pixel’s color (0-255)

    Declaration

    Swift

    public let red: UInt8
  • The intensity of green in the pixel’s color (0-255)

    Declaration

    Swift

    public let green: UInt8
  • The intensity of blue in the pixel’s color (0-255)

    Declaration

    Swift

    public let blue: UInt8
  • A grayscale intensity for the pixel.

    Declaration

    Swift

    public var intensity: UInt8 { get }
  • A textual representation of the RGB channels

    Declaration

    Swift

    public var description: String { get }
  • A pixel with all 0 intensities.

    Declaration

    Swift

    public static let black: Pixel