class

Sixteen::Color

Inherits Reference < Object

Constructors

new(r : UInt8, g : UInt8, b : UInt8)
Source
new(ctx, value)
Source
new(hex : String)
Source
new(*, h, s, l)
Source

Instance methods

b=(b : UInt8)
Source
colorize

Turns self into a Colorize::Object.

Source
contrast(other : Color) : Float64

WCAG contrast ratio between this color and another (1.0 to 21.0)

Source
dark?
Source
darker(amount : Float64 = 0.1)
Source
g=(g : UInt8)
Source
hex_bgr
Source
hue2rgb(p, q, t)
Source
invert_for_theme(target : Symbol) : Color

Smart color inversion for theme generation Maintains color relationships while adapting brightness

Source
light?
Source
lighter(amount : Float64 = 0.1)
Source
r=(r : UInt8)
Source
relative_luminance

WCAG 2.x relative luminance

Source
to_s

Returns a nicely readable and concise string representation of this object, typically intended for users.

This method should usually not be overridden. It delegates to #to_s(IO) which can be overridden for custom implementations.

Also see #inspect.

Source