Sixteen::Color
Inherits Reference < Object
Constructors
new(r : UInt8, g : UInt8, b : UInt8)
Sourcenew(ctx, value)
Sourcenew(hex : String)
Sourcenew(*, h, s, l)
SourceInstance methods
b=(b : UInt8)
Sourcecontrast(other : Color) : Float64
WCAG contrast ratio between this color and another (1.0 to 21.0)
dark?
Sourcedarker(amount : Float64 = 0.1)
Sourceg=(g : UInt8)
Sourcehex
Sourcehex_bgr
Sourcehsl
Sourcehue2rgb(p, q, t)
Sourceinvert_for_theme(target : Symbol) : Color
Smart color inversion for theme generation Maintains color relationships while adapting brightness
light?
Sourcelighter(amount : Float64 = 0.1)
Sourcer=(r : UInt8)
Sourceto_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.