Class Color::YIQ
In: lib/color.rb
lib/color/yiq.rb
Parent: Object

A colour object representing YIQ (NTSC) colour encoding.

Methods

Attributes

i  [RW] 
q  [RW] 
y  [RW] 

Public Class methods

Creates a YIQ colour object from fractional values 0 .. 1.

  Color::YIQ.new(0.3, 0.2, 0.1)

Creates a YIQ colour object from percentages 0 .. 100.

  Color::YIQ.new(10, 20, 30)

Public Instance methods

Compares the other colour to this one. The other colour will be converted to YIQ before comparison, so the comparison between a YIQ colour and a non-YIQ colour will be approximate and based on the other colour‘s to_yiq conversion. If there is no to_yiq conversion, this will raise an exception. This will report that two YIQ values are equivalent if all component colours are within 1e-4 (0.0001) of each other.

to_greyscale()

Alias for to_grayscale

[Validate]