module ChunkyPNG
def self.Color(*args) # rubocop:disable Naming/MethodName # API backwards compatibility
- See: ChunkyPNG::Color.parse -
See: ChunkyPNG::Color -
Raises:
-
(ArgumentError)
- if the arguments weren't understood as a color.
Returns:
-
(Integer)
- The determined color value as RGBA integer. -
(Integer)
- The color value, with the opacity applied if one was -
(Integer)
- The hex color value, with the opacity applied if one -
(Integer)
- The hex color value, with the opacity applied if one -
(Integer)
- The rgb color value. -
(Integer)
- The rgba color value.
Parameters:
-
The
(Integer, :to_i
) -- color value. -
(
) --
-
(
) --
-
(
) --
-
(
) --
Overloads:
-
Color(color_value, opacity = nil)
-
Color(color_name, opacity = nil)
-
Color(hex_value, opacity = nil)
-
Color(r, g, b)
-
Color(r, g, b, a)
def self.Color(*args) # rubocop:disable Naming/MethodName # API backwards compatibility case args.length when 1 then ChunkyPNG::Color.parse(args.first) when 2 then (ChunkyPNG::Color.parse(args.first) & 0xffffff00) | args[1].to_i when 3 then ChunkyPNG::Color.rgb(*args) when 4 then ChunkyPNG::Color.rgba(*args) else raise ArgumentError, "Don't know how to create a color from #{args.inspect}!" end end