class Game::Color

Defined in:

game/color.cr

Constant Summary

Aqua = Game::Color::Cyan
Black = new

Blacks

Blue = new(blue: 255)

Blues

Brown = new(red: 165, green: 42, blue: 42)

Browns

Chocolate = new(red: 210, green: 105, blue: 30)
Coral = new(red: 255, green: 127, blue: 80)
Crimson = new(red: 220, green: 20, blue: 60)
Cyan = new(blue: 255, green: 255)
DarkBlue = new(blue: 139)
DarkCyan = new(green: 139, blue: 139)
DarkEbony = new(red: 55, green: 49, blue: 43)
DarkerGray = new(color: 70)
DarkerGrey = Game::Color::DarkerGray
DarkGray = new(color: 169)
DarkGreen = new(green: 100)
DarkGrey = Game::Color::DarkGray
DarkKhaki = new(red: 189, green: 183, blue: 107)
DarkMagenta = new(red: 139, blue: 139)
DarkOrange = new(red: 255, green: 140)
DarkRed = new(red: 139)
DarkTurquoise = new(green: 206, blue: 209)
DarkViolet = new(red: 138, green: 43, blue: 226)
DeepPink = new(red: 255, green: 20, blue: 147)
DimGray = new(color: 105)
DimGrey = Game::Color::DimGray
FireBrick = new(red: 178, green: 34, blue: 34)
ForestGreen = new(red: 34, green: 139, blue: 34)
Fuschia = Game::Color::Magenta
Gold = new(red: 255, green: 215)
GoldenRod = new(red: 218, green: 165, blue: 32)
Gray = new(color: 128)

Grays

Green = new(green: 128)

Green

GreenYellow = new(red: 173, green: 255, blue: 47)
Grey = Game::Color::Gray
GunSmoke = new(red: 122, green: 124, blue: 118)
HotPink = new(red: 255, green: 105, blue: 180)
Indigo = new(red: 75, blue: 130)
Ivory = new(red: 255, green: 255, blue: 240)
Khaki = new(red: 240, green: 230, blue: 140)
Lavender = new(red: 230, green: 230, blue: 250)
LightBlue = new(red: 173, green: 216, blue: 230)
LightGray = new(color: 211)
LightGrey = Game::Color::LightGray
Lime = new(green: 255)
LimeGreen = new(red: 50, green: 205, blue: 50)
Magenta = new(red: 255, blue: 255)
Maroon = new(red: 128)
Moccasin = new(red: 255, green: 228, blue: 181)
Navy = new(blue: 128)
Olive = new(red: 128, green: 128)
Orange = new(red: 255, green: 165)

Oranges

OrangeRed = new(red: 255, green: 69)
Peru = new(red: 205, green: 133, blue: 63)
Pink = new(red: 255, green: 192, blue: 203)
Purple = new(red: 128, blue: 128)

Purples

Red = new(red: 255)

Reds

RoyalBlue = new(red: 65, green: 105, blue: 225)
SaddleBrown = new(red: 139, green: 69, blue: 19)
Salmon = new(red: 250, green: 128, blue: 114)
SandyWood = new(red: 244, green: 164, blue: 96)
SeaGreen = new(red: 46, green: 139, blue: 87)
Sienna = new(red: 160, green: 82, blue: 45)
Silver = new(color: 192)
Snow = new(red: 255, green: 250, blue: 250)
SpringGreen = new(green: 255, blue: 127)
Tan = new(red: 210, green: 180, blue: 140)
Teal = new(green: 128, blue: 128)
Tomato = new(red: 255, green: 99, blue: 71)
Transparent = new(color: 0, alpha: 0)

Transparent

Turquoise = new(red: 64, green: 224, blue: 208)
Violet = new(red: 238, green: 130, blue: 238)
White = new(color: 255)

Whites

WhiteSmoke = new(red: 245, green: 245, blue: 245)
Yellow = new(red: 255, green: 255)

Yellows

YellowGreen = new(red: 154, green: 205, blue: 50)

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(color = nil, red = 0, green = 0, blue = 0, alpha = 255) #

[View source]

Class Method Detail

def self.from_hex(hex_input) #

[View source]
def self.random #

[View source]

Instance Method Detail

def add_alpha(value : UInt8) #

[View source]
def add_alpha(percent : Float32 | Float64) #

[View source]
def add_blue(value : UInt8) #

[View source]
def add_blue(percent : Float32 | Float64) #

[View source]
def add_green(value : UInt8) #

[View source]
def add_green(percent : Float32 | Float64) #

[View source]
def add_red(value : UInt8) #

[View source]
def add_red(percent : Float32 | Float64) #

[View source]
def alpha(value : UInt8) #

[View source]
def alpha(percent : Float32 | Float64) #

[View source]
def alpha : UInt8 #

[View source]
def blue(value : UInt8) #

[View source]
def blue(percent : Float32 | Float64) #

[View source]
def blue : UInt8 #

[View source]
def clone #

[View source]
def green(value : UInt8) #

[View source]
def green(percent : Float32 | Float64) #

[View source]
def green : UInt8 #

[View source]
def red(value : UInt8) #

[View source]
def red(percent : Float32 | Float64) #

[View source]
def red : UInt8 #

[View source]
def to_hex #

[View source]
def to_s(io : IO) #
Description copied from class Reference

Appends a short String representation of this object which includes its class name and its object address.

class Person
  def initialize(@name : String, @age : Int32)
  end
end

Person.new("John", 32).to_s # => #<Person:0x10a199f20>

[View source]
def to_struct #

[View source]