Documentation
¶
Overview ¶
Package color provides a RGB565 color. Sections of this file have been copied from github.com/ev3go/ev3dev/fb/rgb565.go under the following copyright license: Copyright ©2016 The ev3go Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( Red = New(255, 0, 0) Green = New(0, 255, 0) Blue = New(0, 0, 255) Black = New(0, 0, 0) // Off White = New(255, 255, 255) Magenta = New(209, 13, 62) )
Predefined colors
var RGB565Model = color.ModelFunc(rgb565Model)
RGB565Model is the color model for RGB565 images.
Functions ¶
func NewRGB565With ¶
NewRGB565With returns a new RGB565 image with the given bounds, backed by the []byte, pix. If stride is zero, a working stride is computed. If the length of pix is less than stride*h, an error is returned.
Types ¶
type Pixel565 ¶
type Pixel565 uint16
Pixel565 represents a non-alpha-premultiplied 16-bit color.
func RandomPlan9PaletteColor ¶
func RandomPlan9PaletteColor() Pixel565
RandomPlan9PaletteColor returns a random color from the palette.Plan9 slice.
type RGB565 ¶
type RGB565 struct { // Pix holds the image's pixels, as RGB565 values. // The Pixel565 at (x, y) is the pair of bytes at // Pix[2*(x-Rect.Min.X) + (y-Rect.Min.Y)*Stride]. // Pixel565 values are encoded little endian in Pix. Pix []uint8 // Stride is the Pix stride (in bytes) between // vertically adjacent pixels. Stride int // Rect is the image's bounds. Rect image.Rectangle }
RGB565 is an in-memory image whose At method returns Pixel565 values.
func (*RGB565) ColorModel ¶
ColorModel returns the RGB565 color model.