package color
Import Path
image/color (on go.dev )
Dependency Relation
imports 0 packages, and imported by 8 packages
Package-Level Type Names (total 15, in which 14 are exported)
/* sort exporteds by: alphabet | popularity */
type Alpha16 (struct)
Alpha16 represents a 16-bit alpha color.
Fields (only one, which is exported )
A uint16
Methods (only one, which is exported )
( Alpha16) RGBA () (r, g, b, a uint32 )
Implements (at least 2, both are exported )
Alpha16 : Color
Alpha16 : github.com/charmbracelet/x/ansi.Color
As Outputs Of (at least one exported )
func image.(*Alpha16 ).Alpha16At (x, y int ) Alpha16
As Inputs Of (at least one exported )
func image.(*Alpha16 ).SetAlpha16 (x, y int , c Alpha16 )
As Types Of (total 2, both are exported )
var Opaque
var Transparent
type CMYK (struct)
CMYK represents a fully opaque CMYK color, having 8 bits for each of cyan,
magenta, yellow and black.
It is not associated with any particular color profile.
Fields (total 4, all are exported )
C uint8
K uint8
M uint8
Y uint8
Methods (only one, which is exported )
( CMYK) RGBA () (uint32 , uint32 , uint32 , uint32 )
Implements (at least 2, both are exported )
CMYK : Color
CMYK : github.com/charmbracelet/x/ansi.Color
As Outputs Of (at least one exported )
func image.(*CMYK ).CMYKAt (x, y int ) CMYK
As Inputs Of (at least one exported )
func image.(*CMYK ).SetCMYK (x, y int , c CMYK )
type Color (interface)
Color can convert itself to alpha-premultiplied 16-bits per channel RGBA.
The conversion may be lossy.
Methods (only one, which is exported )
( Color) RGBA () (r, g, b, a uint32 )
RGBA returns the alpha-premultiplied red, green, blue and alpha values
for the color. Each value ranges within [0, 0xffff], but is represented
by a uint32 so that multiplying by a blend factor up to 0xffff will not
overflow.
An alpha-premultiplied color component c has been scaled by alpha (a),
so has valid values 0 <= c <= a.
Implemented By (at least 26, all are exported )
Alpha
Alpha16
CMYK
Gray
Gray16
NRGBA
NRGBA64
NYCbCrA
RGBA
RGBA64
YCbCr
*image.Uniform
charm.land/lipgloss/v2.NoColor
charm.land/lipgloss/v2.RGBColor
github.com/charmbracelet/ultraviolet.BackgroundColorEvent
github.com/charmbracelet/ultraviolet.CursorColorEvent
github.com/charmbracelet/ultraviolet.ForegroundColorEvent
github.com/charmbracelet/x/ansi.BasicColor
github.com/charmbracelet/x/ansi.Color (interface)
github.com/charmbracelet/x/ansi.HexColor
github.com/charmbracelet/x/ansi.IndexedColor
github.com/charmbracelet/x/ansi.RGBColor
github.com/charmbracelet/x/ansi.TrueColor
github.com/charmbracelet/x/ansi.XRGBAColor
github.com/charmbracelet/x/ansi.XRGBColor
github.com/lucasb-eyer/go-colorful.Color
Implements (at least one exported )
Color : github.com/charmbracelet/x/ansi.Color
As Outputs Of (at least 64, in which 45 are exported )
func Model .Convert (c Color ) Color
func Palette .Convert (c Color ) Color
func image.(*Alpha ).At (x, y int ) Color
func image.(*Alpha16 ).At (x, y int ) Color
func image.(*CMYK ).At (x, y int ) Color
func image.(*Gray ).At (x, y int ) Color
func image.(*Gray16 ).At (x, y int ) Color
func image.Image .At (x, y int ) Color
func image.(*NRGBA ).At (x, y int ) Color
func image.(*NRGBA64 ).At (x, y int ) Color
func image.(*NYCbCrA ).At (x, y int ) Color
func image.(*Paletted ).At (x, y int ) Color
func image.PalettedImage .At (x, y int ) Color
func image.Rectangle .At (x, y int ) Color
func image.(*RGBA ).At (x, y int ) Color
func image.(*RGBA64 ).At (x, y int ) Color
func image.RGBA64Image .At (x, y int ) Color
func image.(*Uniform ).At (x, y int ) Color
func image.(*Uniform ).Convert (Color ) Color
func image.(*YCbCr ).At (x, y int ) Color
func charm.land/lipgloss/v2.Alpha (c Color , alpha float64 ) Color
func charm.land/lipgloss/v2.BackgroundColor (in term .File , out term .File ) (bg Color , err error )
func charm.land/lipgloss/v2.Blend1D (steps int , stops ...Color ) []Color
func charm.land/lipgloss/v2.Blend2D (width, height int , angle float64 , stops ...Color ) []Color
func charm.land/lipgloss/v2.Color (s string ) Color
func charm.land/lipgloss/v2.Complementary (c Color ) Color
func charm.land/lipgloss/v2.Darken (c Color , percent float64 ) Color
func charm.land/lipgloss/v2.Lighten (c Color , percent float64 ) Color
func charm.land/lipgloss/v2.Style .GetBackground () Color
func charm.land/lipgloss/v2.Style .GetBorderBottomBackground () Color
func charm.land/lipgloss/v2.Style .GetBorderBottomForeground () Color
func charm.land/lipgloss/v2.Style .GetBorderForegroundBlend () []Color
func charm.land/lipgloss/v2.Style .GetBorderLeftBackground () Color
func charm.land/lipgloss/v2.Style .GetBorderLeftForeground () Color
func charm.land/lipgloss/v2.Style .GetBorderRightBackground () Color
func charm.land/lipgloss/v2.Style .GetBorderRightForeground () Color
func charm.land/lipgloss/v2.Style .GetBorderTopBackground () Color
func charm.land/lipgloss/v2.Style .GetBorderTopForeground () Color
func charm.land/lipgloss/v2.Style .GetForeground () Color
func charm.land/lipgloss/v2.Style .GetUnderlineColor () Color
func github.com/charmbracelet/colorprofile.Profile .Convert (c Color ) (cc Color )
func github.com/charmbracelet/ultraviolet.(*TerminalScreen ).BackgroundColor () Color
func github.com/charmbracelet/ultraviolet.(*TerminalScreen ).CursorColor () Color
func github.com/charmbracelet/ultraviolet.(*TerminalScreen ).ForegroundColor () Color
func github.com/charmbracelet/x/ansi.XParseColor (s string ) Color
/* 19+ unexporteds ... */ /* 19+ unexporteds: */
func alpha16Model (c Color ) Color
func alphaModel (c Color ) Color
func cmykModel (c Color ) Color
func gray16Model (c Color ) Color
func grayModel (c Color ) Color
func nrgba64Model (c Color ) Color
func nrgbaModel (c Color ) Color
func nYCbCrAModel (c Color ) Color
func rgba64Model (c Color ) Color
func rgbaModel (c Color ) Color
func yCbCrModel (c Color ) Color
func charm.land/lipgloss/v2.backgroundColor (in term .File , out term .File ) (Color , error )
func charm.land/lipgloss/v2.colorOrNil (c any ) Color
func charm.land/lipgloss/v2.ensureNotTransparent (c Color ) Color
func charm.land/lipgloss/v2.queryBackgroundColor (in io .Reader , out io .Writer ) (c Color , err error )
func charm.land/lipgloss/v2.whichSidesColor (i ...Color ) (top, right, bottom, left Color , ok bool )
func charm.land/lipgloss/v2.Style .getAsColor (k lipgloss .propKey ) Color
func charm.land/lipgloss/v2.Style .getAsColors (k lipgloss .propKey ) (colors []Color )
func github.com/charmbracelet/x/ansi.ansiToRGB (ansi byte ) Color
As Inputs Of (at least 70, in which 48 are exported )
func Model .Convert (c Color ) Color
func Palette .Convert (c Color ) Color
func Palette .Index (c Color ) int
func image.NewUniform (c Color ) *image .Uniform
func image.(*Alpha ).Set (x, y int , c Color )
func image.(*Alpha16 ).Set (x, y int , c Color )
func image.(*CMYK ).Set (x, y int , c Color )
func image.(*Gray ).Set (x, y int , c Color )
func image.(*Gray16 ).Set (x, y int , c Color )
func image.(*NRGBA ).Set (x, y int , c Color )
func image.(*NRGBA64 ).Set (x, y int , c Color )
func image.(*Paletted ).Set (x, y int , c Color )
func image.(*RGBA ).Set (x, y int , c Color )
func image.(*RGBA64 ).Set (x, y int , c Color )
func image.(*Uniform ).Convert (Color ) Color
func charm.land/lipgloss/v2.Alpha (c Color , alpha float64 ) Color
func charm.land/lipgloss/v2.Blend1D (steps int , stops ...Color ) []Color
func charm.land/lipgloss/v2.Blend2D (width, height int , angle float64 , stops ...Color ) []Color
func charm.land/lipgloss/v2.Complementary (c Color ) Color
func charm.land/lipgloss/v2.Darken (c Color , percent float64 ) Color
func charm.land/lipgloss/v2.Lighten (c Color , percent float64 ) Color
func charm.land/lipgloss/v2.Style .Background (c Color ) lipgloss .Style
func charm.land/lipgloss/v2.Style .BorderBackground (c ...Color ) lipgloss .Style
func charm.land/lipgloss/v2.Style .BorderBottomBackground (c Color ) lipgloss .Style
func charm.land/lipgloss/v2.Style .BorderBottomForeground (c Color ) lipgloss .Style
func charm.land/lipgloss/v2.Style .BorderForeground (c ...Color ) lipgloss .Style
func charm.land/lipgloss/v2.Style .BorderForegroundBlend (c ...Color ) lipgloss .Style
func charm.land/lipgloss/v2.Style .BorderLeftBackground (c Color ) lipgloss .Style
func charm.land/lipgloss/v2.Style .BorderLeftForeground (c Color ) lipgloss .Style
func charm.land/lipgloss/v2.Style .BorderRightBackground (c Color ) lipgloss .Style
func charm.land/lipgloss/v2.Style .BorderRightForeground (c Color ) lipgloss .Style
func charm.land/lipgloss/v2.Style .BorderTopBackground (c Color ) lipgloss .Style
func charm.land/lipgloss/v2.Style .BorderTopForeground (c Color ) lipgloss .Style
func charm.land/lipgloss/v2.Style .Foreground (c Color ) lipgloss .Style
func charm.land/lipgloss/v2.Style .MarginBackground (c Color ) lipgloss .Style
func charm.land/lipgloss/v2.Style .UnderlineColor (c Color ) lipgloss .Style
func github.com/charmbracelet/colorprofile.Profile .Convert (c Color ) (cc Color )
func github.com/charmbracelet/ultraviolet.EncodeBackgroundColor (w io .Writer , c Color ) error
func github.com/charmbracelet/ultraviolet.EncodeCursorColor (w io .Writer , c Color ) error
func github.com/charmbracelet/ultraviolet.EncodeForegroundColor (w io .Writer , c Color ) error
func github.com/charmbracelet/ultraviolet.(*TerminalScreen ).SetBackgroundColor (c Color )
func github.com/charmbracelet/ultraviolet.(*TerminalScreen ).SetCursorColor (c Color )
func github.com/charmbracelet/ultraviolet.(*TerminalScreen ).SetForegroundColor (c Color )
func github.com/charmbracelet/x/ansi.Convert16 (c Color ) ansi .BasicColor
func github.com/charmbracelet/x/ansi.Convert256 (c Color ) ansi .IndexedColor
func github.com/charmbracelet/x/ansi.ReadStyleColor (params ansi .Params , co *Color ) int
func github.com/charmbracelet/x/ansi.SetPalette (i int , c Color ) string
func github.com/lucasb-eyer/go-colorful.MakeColor (col Color ) (colorful .Color , bool )
/* 22+ unexporteds ... */ /* 22+ unexporteds: */
func alpha16Model (c Color ) Color
func alphaModel (c Color ) Color
func cmykModel (c Color ) Color
func gray16Model (c Color ) Color
func grayModel (c Color ) Color
func nrgba64Model (c Color ) Color
func nrgbaModel (c Color ) Color
func nYCbCrAModel (c Color ) Color
func rgba64Model (c Color ) Color
func rgbaModel (c Color ) Color
func yCbCrModel (c Color ) Color
func charm.land/lipgloss/v2.ensureNotTransparent (c Color ) Color
func charm.land/lipgloss/v2.isDarkColor (c Color ) bool
func charm.land/lipgloss/v2.whichSidesColor (i ...Color ) (top, right, bottom, left Color , ok bool )
func charm.land/lipgloss/v2.Style .borderBlend (width, height int , colors ...Color ) *lipgloss .borderBlend
func charm.land/lipgloss/v2.Style .styleBorder (border string , fg, bg Color ) string
func charm.land/lipgloss/v2.Style .styleBorderBlend (border string , fg []Color , bg Color ) string
func charm.land/lipgloss/v2.Style .styleBorderBlend (border string , fg []Color , bg Color ) string
func github.com/charmbracelet/ultraviolet.colorEqual (c, o Color ) bool
func github.com/charmbracelet/ultraviolet.colorToHex (c Color ) string
func github.com/charmbracelet/ultraviolet.isDarkColor (c Color ) bool
func github.com/charmbracelet/x/ansi.colorToHexString (c Color ) string
type Gray16 (struct)
Gray16 represents a 16-bit grayscale color.
Fields (only one, which is exported )
Y uint16
Methods (only one, which is exported )
( Gray16) RGBA () (r, g, b, a uint32 )
Implements (at least 2, both are exported )
Gray16 : Color
Gray16 : github.com/charmbracelet/x/ansi.Color
As Outputs Of (at least one exported )
func image.(*Gray16 ).Gray16At (x, y int ) Gray16
As Inputs Of (at least one exported )
func image.(*Gray16 ).SetGray16 (x, y int , c Gray16 )
As Types Of (total 2, both are exported )
var Black
var White
type NRGBA64 (struct)
NRGBA64 represents a non-alpha-premultiplied 64-bit color,
having 16 bits for each of red, green, blue and alpha.
Fields (total 4, all are exported )
A uint16
B uint16
G uint16
R uint16
Methods (only one, which is exported )
( NRGBA64) RGBA () (r, g, b, a uint32 )
Implements (at least 2, both are exported )
NRGBA64 : Color
NRGBA64 : github.com/charmbracelet/x/ansi.Color
As Outputs Of (at least one exported )
func image.(*NRGBA64 ).NRGBA64At (x, y int ) NRGBA64
As Inputs Of (at least one exported )
func image.(*NRGBA64 ).SetNRGBA64 (x, y int , c NRGBA64 )
type RGBA (struct)
RGBA represents a traditional 32-bit alpha-premultiplied color, having 8
bits for each of red, green, blue and alpha.
An alpha-premultiplied color component C has been scaled by alpha (A), so
has valid values 0 <= C <= A.
Fields (total 4, all are exported )
A uint8
B uint8
G uint8
R uint8
Methods (only one, which is exported )
( RGBA) RGBA () (r, g, b, a uint32 )
Implements (at least 2, both are exported )
RGBA : Color
RGBA : github.com/charmbracelet/x/ansi.Color
As Outputs Of (at least 2, in which 1 is exported )
func image.(*RGBA ).RGBAAt (x, y int ) RGBA
/* at least one unexported ... */ /* at least one unexported: */
func charm.land/lipgloss/v2.parseHex (s string ) (c RGBA , err error )
As Inputs Of (at least one exported )
func image.(*RGBA ).SetRGBA (x, y int , c RGBA )
type RGBA64 (struct)
RGBA64 represents a 64-bit alpha-premultiplied color, having 16 bits for
each of red, green, blue and alpha.
An alpha-premultiplied color component C has been scaled by alpha (A), so
has valid values 0 <= C <= A.
Fields (total 4, all are exported )
A uint16
B uint16
G uint16
R uint16
Methods (only one, which is exported )
( RGBA64) RGBA () (r, g, b, a uint32 )
Implements (at least 2, both are exported )
RGBA64 : Color
RGBA64 : github.com/charmbracelet/x/ansi.Color
As Outputs Of (at least 15, all are exported )
func image.(*Alpha ).RGBA64At (x, y int ) RGBA64
func image.(*Alpha16 ).RGBA64At (x, y int ) RGBA64
func image.(*CMYK ).RGBA64At (x, y int ) RGBA64
func image.(*Gray ).RGBA64At (x, y int ) RGBA64
func image.(*Gray16 ).RGBA64At (x, y int ) RGBA64
func image.(*NRGBA ).RGBA64At (x, y int ) RGBA64
func image.(*NRGBA64 ).RGBA64At (x, y int ) RGBA64
func image.(*NYCbCrA ).RGBA64At (x, y int ) RGBA64
func image.(*Paletted ).RGBA64At (x, y int ) RGBA64
func image.Rectangle .RGBA64At (x, y int ) RGBA64
func image.(*RGBA ).RGBA64At (x, y int ) RGBA64
func image.(*RGBA64 ).RGBA64At (x, y int ) RGBA64
func image.RGBA64Image .RGBA64At (x, y int ) RGBA64
func image.(*Uniform ).RGBA64At (x, y int ) RGBA64
func image.(*YCbCr ).RGBA64At (x, y int ) RGBA64
As Inputs Of (at least 10, all are exported )
func image.(*Alpha ).SetRGBA64 (x, y int , c RGBA64 )
func image.(*Alpha16 ).SetRGBA64 (x, y int , c RGBA64 )
func image.(*CMYK ).SetRGBA64 (x, y int , c RGBA64 )
func image.(*Gray ).SetRGBA64 (x, y int , c RGBA64 )
func image.(*Gray16 ).SetRGBA64 (x, y int , c RGBA64 )
func image.(*NRGBA ).SetRGBA64 (x, y int , c RGBA64 )
func image.(*NRGBA64 ).SetRGBA64 (x, y int , c RGBA64 )
func image.(*Paletted ).SetRGBA64 (x, y int , c RGBA64 )
func image.(*RGBA ).SetRGBA64 (x, y int , c RGBA64 )
func image.(*RGBA64 ).SetRGBA64 (x, y int , c RGBA64 )
type YCbCr (struct)
YCbCr represents a fully opaque 24-bit Y'CbCr color, having 8 bits each for
one luma and two chroma components.
JPEG, VP8, the MPEG family and other codecs use this color model. Such
codecs often use the terms YUV and Y'CbCr interchangeably, but strictly
speaking, the term YUV applies only to analog video signals, and Y' (luma)
is Y (luminance) after applying gamma correction.
Conversion between RGB and Y'CbCr is lossy and there are multiple, slightly
different formulae for converting between the two. This package follows
the JFIF specification at https://www.w3.org/Graphics/JPEG/jfif3.pdf.
Fields (total 3, all are exported )
Cb uint8
Cr uint8
Y uint8
Methods (only one, which is exported )
( YCbCr) RGBA () (uint32 , uint32 , uint32 , uint32 )
Implements (at least 2, both are exported )
YCbCr : Color
YCbCr : github.com/charmbracelet/x/ansi.Color
As Outputs Of (at least one exported )
func image.(*YCbCr ).YCbCrAt (x, y int ) YCbCr
Package-Level Variables (total 15, all are exported)