Class: Cute::Color

Inherits:
Object
  • Object
show all
Defined in:
docstub/color.rb

Instance Method Summary collapse

Constructor Details

#initializeColor

Returns a new instance of Color.

Parameters:

  • r (Float)

    Red component (0.0 to 1.0), defaults to 0.0

  • g (Float)

    Green component (0.0 to 1.0), defaults to 0.0

  • b (Float)

    Blue component (0.0 to 1.0), defaults to 0.0

  • a (Float)

    Alpha component (0.0 to 1.0), defaults to 1.0



12
13
# File 'docstub/color.rb', line 12

def initialize(r = 0.0, g = 0.0, b = 0.0, a = 1.0)
end

Instance Method Details

#aFloat

Returns Alpha component value (0.0 to 1.0).

Returns:

  • (Float)

    Alpha component value (0.0 to 1.0)



57
58
# File 'docstub/color.rb', line 57

def a
end

#a=Float

Returns The new value.

Parameters:

  • value (Float)

    New alpha component value (0.0 to 1.0)

Returns:

  • (Float)

    The new value



64
65
# File 'docstub/color.rb', line 64

def a=(value)
end

#addColor

Returns A new color with added components.

Parameters:

  • other (Color)

    The color to add

Returns:

  • (Color)

    A new color with added components



90
91
# File 'docstub/color.rb', line 90

def add(other)
end

#bFloat

Returns Blue component value (0.0 to 1.0).

Returns:

  • (Float)

    Blue component value (0.0 to 1.0)



44
45
# File 'docstub/color.rb', line 44

def b
end

#b=Float

Returns The new value.

Parameters:

  • value (Float)

    New blue component value (0.0 to 1.0)

Returns:

  • (Float)

    The new value



51
52
# File 'docstub/color.rb', line 51

def b=(value)
end

#gFloat

Returns Green component value (0.0 to 1.0).

Returns:

  • (Float)

    Green component value (0.0 to 1.0)



31
32
# File 'docstub/color.rb', line 31

def g
end

#g=Float

Returns The new value.

Parameters:

  • value (Float)

    New green component value (0.0 to 1.0)

Returns:

  • (Float)

    The new value



38
39
# File 'docstub/color.rb', line 38

def g=(value)
end

#inspectString

Returns Detailed string representation.

Returns:

  • (String)

    Detailed string representation



76
77
# File 'docstub/color.rb', line 76

def inspect
end

#mulColor

Returns A new color with multiplied components.

Parameters:

  • s (Float)

    Scalar value to multiply by

Returns:

  • (Color)

    A new color with multiplied components



83
84
# File 'docstub/color.rb', line 83

def mul(s)
end

#rFloat

Returns Red component value (0.0 to 1.0).

Returns:

  • (Float)

    Red component value (0.0 to 1.0)



18
19
# File 'docstub/color.rb', line 18

def r
end

#r=Float

Returns The new value.

Parameters:

  • value (Float)

    New red component value (0.0 to 1.0)

Returns:

  • (Float)

    The new value



25
26
# File 'docstub/color.rb', line 25

def r=(value)
end

#subColor

Returns A new color with subtracted components.

Parameters:

  • other (Color)

    The color to subtract

Returns:

  • (Color)

    A new color with subtracted components



97
98
# File 'docstub/color.rb', line 97

def sub(other)
end

#to_pixelPixel

Returns A new Pixel instance with equivalent color values.

Returns:

  • (Pixel)

    A new Pixel instance with equivalent color values



103
104
# File 'docstub/color.rb', line 103

def to_pixel
end

#to_sString

Returns String representation.

Returns:

  • (String)

    String representation



70
71
# File 'docstub/color.rb', line 70

def to_s
end