Class: Gtk::ColorButton

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Instance Method Summary collapse

Instance Method Details

#alphaInteger

The selected opacity value (0 fully transparent, 65535 fully opaque).

Returns:

  • (Integer)

    alpha

#alpha=(alpha) ⇒ Integer

The selected opacity value (0 fully transparent, 65535 fully opaque).

Parameters:

  • alpha (Integer)

Returns:

  • (Integer)

    alpha

  • (Integer)

    alpha

#colorGdk::Color

The selected color.

Returns:

  • (Gdk::Color)

    color

#color=(color) ⇒ Gdk::Color

The selected color.

Parameters:

  • color (Gdk::Color)

Returns:

  • (Gdk::Color)

    color

  • (Gdk::Color)

    color

#get_color(color) ⇒ nil

Sets color to be the current color in the Gtk::ColorButton widget.

Parameters:

  • color (Gdk::Color)

    a Gdk::Color to fill in with the current color

Returns:

  • (nil)

#get_rgba(rgba) ⇒ nil

Sets rgba to be the current color in the Gtk::ColorButton widget.

Parameters:

  • rgba (Gdk::RGBA)

    a Gdk::RGBA to fill in with the current color

Returns:

  • (nil)

#newGtk::Widget

Creates a new color button.

This returns a widget in the form of a small button containing a swatch representing the current selected color. When the button is clicked, a color-selection dialog will open, allowing the user to select a color. The swatch will be updated to reflect the new color when the user finishes.

Returns:

#new_with_color(color) ⇒ Gtk::Widget

Creates a new color button.

Parameters:

  • color (Gdk::Color)

    A Gdk::Color to set the current color with

Returns:

#new_with_rgba(rgba) ⇒ Gtk::Widget

Creates a new color button.

Parameters:

  • rgba (Gdk::RGBA)

    A Gdk::RGBA to set the current color with

Returns:

#rgbaGdk::RGBA

The RGBA color.

Returns:

  • (Gdk::RGBA)

    rgba

#rgba=(rgba) ⇒ Gdk::RGBA

The RGBA color.

Parameters:

  • rgba (Gdk::RGBA)

Returns:

  • (Gdk::RGBA)

    rgba

  • (Gdk::RGBA)

    rgba

#show_editor=(show_editor) ⇒ TrueClass

Set this property to true to skip the palette in the dialog and go directly to the color editor.

This property should be used in cases where the palette in the editor would be redundant, such as when the color button is already part of a palette.

Parameters:

  • show_editor (TrueClass)

Returns:

  • (TrueClass)

    show-editor

  • (TrueClass)

    show-editor

#show_editor?TrueClass

Set this property to true to skip the palette in the dialog and go directly to the color editor.

This property should be used in cases where the palette in the editor would be redundant, such as when the color button is already part of a palette.

Returns:

  • (TrueClass)

    show-editor

#titleString

The title of the color selection dialog

Returns:

  • (String)

    title

#title=(title) ⇒ String

The title of the color selection dialog

Parameters:

  • title (String)

Returns:

  • (String)

    title

  • (String)

    title

#use_alphaTrueClass

Does the color selection dialog use the alpha channel ?

Returns:

  • (TrueClass)

    true if the color sample uses alpha channel, false if not

#use_alpha=(use_alpha) ⇒ TrueClass

If this property is set to true, the color swatch on the button is rendered against a checkerboard background to show its opacity and the opacity slider is displayed in the color selection dialog.

Parameters:

  • use_alpha (TrueClass)

Returns:

  • (TrueClass)

    use-alpha

  • (TrueClass)

    use-alpha

#use_alpha?TrueClass

If this property is set to true, the color swatch on the button is rendered against a checkerboard background to show its opacity and the opacity slider is displayed in the color selection dialog.

Returns:

  • (TrueClass)

    use-alpha