ansel/color
Predefined colors and color functions to be used with Ansel image operations.
Types
Colors supported by Ansel operations. The RGB and RGBA constructors can be used to create custom colors. Of course, the GleamLucy and GleamNavy colors are included ;)
pub type Color {
RGBA(r: Int, g: Int, b: Int, a: Int)
RGB(r: Int, g: Int, b: Int)
GleamLucy
GleamNavy
Maroon
DarkRed
Brown
Firebrick
Crimson
Red
Tomato
Coral
IndianRed
LightCoral
DarkSalmon
Salmon
LightSalmon
OrangeRed
DarkOrange
Orange
Gold
DarkGoldenRod
GoldenRod
PaleGoldenRod
DarkKhaki
Khaki
Olive
Yellow
YellowGreen
DarkOliveGreen
OliveDrab
LawnGreen
Chartreuse
GreenYellow
DarkGreen
Green
ForestGreen
Lime
LimeGreen
LightGreen
PaleGreen
DarkSeaGreen
MediumSpringGreen
SpringGreen
SeaGreen
MediumAquaMarine
MediumSeaGreen
LightSeaGreen
DarkSlateGray
Teal
DarkCyan
Aqua
Cyan
LightCyan
DarkTurquoise
Turquoise
MediumTurquoise
PaleTurquoise
AquaMarine
PowderBlue
CadetBlue
SteelBlue
CornFlowerBlue
DeepSkyBlue
DodgerBlue
LightBlue
SkyBlue
LightSkyBlue
MidnightBlue
Navy
DarkBlue
MediumBlue
Blue
RoyalBlue
BlueViolet
Indigo
DarkSlateBlue
SlateBlue
MediumSlateBlue
MediumPurple
DarkMagenta
DarkViolet
DarkOrchid
MediumOrchid
Purple
Thistle
Plum
Violet
Magenta
Fuchsia
Orchid
MediumVioletRed
PaleVioletRed
DeepPink
HotPink
LightPink
Pink
AntiqueWhite
Beige
Bisque
BlanchedAlmond
Wheat
CornSilk
LemonChiffon
LightGoldenRodYellow
LightYellow
SaddleBrown
Sienna
Chocolate
Peru
SandyBrown
BurlyWood
Tan
RosyBrown
Moccasin
NavajoWhite
PeachPuff
MistyRose
LavenderBlush
Linen
OldLace
PapayaWhip
SeaShell
MintCream
SlateGray
LightSlateGray
LightSteelBlue
Lavender
FloralWhite
AliceBlue
GhostWhite
Honeydew
Ivory
Azure
Snow
Black
DimGray
DimGrey
Gray
Grey
DarkGray
DarkGrey
Silver
LightGray
LightGrey
Gainsboro
WhiteSmoke
White
}
Constructors
-
RGBA(r: Int, g: Int, b: Int, a: Int)
-
RGB(r: Int, g: Int, b: Int)
-
GleamLucy
-
GleamNavy
-
Maroon
-
DarkRed
-
Brown
-
Firebrick
-
Crimson
-
Red
-
Tomato
-
Coral
-
IndianRed
-
LightCoral
-
DarkSalmon
-
Salmon
-
LightSalmon
-
OrangeRed
-
DarkOrange
-
Orange
-
Gold
-
DarkGoldenRod
-
GoldenRod
-
PaleGoldenRod
-
DarkKhaki
-
Khaki
-
Olive
-
Yellow
-
YellowGreen
-
DarkOliveGreen
-
OliveDrab
-
LawnGreen
-
Chartreuse
-
GreenYellow
-
DarkGreen
-
Green
-
ForestGreen
-
Lime
-
LimeGreen
-
LightGreen
-
PaleGreen
-
DarkSeaGreen
-
MediumSpringGreen
-
SpringGreen
-
SeaGreen
-
MediumAquaMarine
-
MediumSeaGreen
-
LightSeaGreen
-
DarkSlateGray
-
Teal
-
DarkCyan
-
Aqua
-
Cyan
-
LightCyan
-
DarkTurquoise
-
Turquoise
-
MediumTurquoise
-
PaleTurquoise
-
AquaMarine
-
PowderBlue
-
CadetBlue
-
SteelBlue
-
CornFlowerBlue
-
DeepSkyBlue
-
DodgerBlue
-
LightBlue
-
SkyBlue
-
LightSkyBlue
-
MidnightBlue
-
Navy
-
DarkBlue
-
MediumBlue
-
Blue
-
RoyalBlue
-
BlueViolet
-
Indigo
-
DarkSlateBlue
-
SlateBlue
-
MediumSlateBlue
-
MediumPurple
-
DarkMagenta
-
DarkViolet
-
DarkOrchid
-
MediumOrchid
-
Purple
-
Thistle
-
Plum
-
Violet
-
Magenta
-
Fuchsia
-
Orchid
-
MediumVioletRed
-
PaleVioletRed
-
DeepPink
-
HotPink
-
LightPink
-
Pink
-
AntiqueWhite
-
Beige
-
Bisque
-
BlanchedAlmond
-
Wheat
-
CornSilk
-
LemonChiffon
-
LightGoldenRodYellow
-
LightYellow
-
SaddleBrown
-
Sienna
-
Chocolate
-
Peru
-
SandyBrown
-
BurlyWood
-
Tan
-
RosyBrown
-
Moccasin
-
NavajoWhite
-
PeachPuff
-
MistyRose
-
LavenderBlush
-
Linen
-
OldLace
-
PapayaWhip
-
SeaShell
-
MintCream
-
SlateGray
-
LightSlateGray
-
LightSteelBlue
-
Lavender
-
FloralWhite
-
AliceBlue
-
GhostWhite
-
Honeydew
-
Ivory
-
Azure
-
Snow
-
Black
-
DimGray
-
DimGrey
-
Gray
-
Grey
-
DarkGray
-
DarkGrey
-
Silver
-
LightGray
-
LightGrey
-
Gainsboro
-
WhiteSmoke
-
White
Functions
pub fn add_alpha_band(to color: Color, of alpha: Int) -> Color
Adds an alpha band of the given value to a color, possibly making it partially transparent.
Example
color.add_alpha_band(color.GleamLucy, of: 128)
|> color.to_rgba_tuple
// -> #(255, 175, 243, 128)
pub fn to_bands(color: Color) -> List(Int)
Returns a color as a list of integer rbg or rbga bands
Example
color.to_bands(color.GleamLucy)
// -> [255, 175, 243]
pub fn to_rgb_tuple(color: Color) -> #(Int, Int, Int)
Returns a color as a tuple of integer rgb bands
Example
color.to_rgb_tuple(color.GleamLucy)
// -> #(255, 175, 243)
pub fn to_rgba_tuple(color: Color) -> #(Int, Int, Int, Int)
Returns a color as a tuple of integer rgba bands
Example
color.to_rgba_tuple(color.GleamLucy)
// -> #(255, 175, 243, 255)