Gimp::UI::ColorButton

Gimp::UI::ColorButton

This widget provides a simple button with a preview showing the color.

On click a Gtk::ColorSelectionDialog is opened. Additionally the button supports Drag and Drop and has a right-click menu that allows to choose the color from the current FG or BG color. If the user changes the color, the "color_changed" signal is emitted.

Note that the color is changed in place.

Superclass

Gtk::Button?

Class methods:

Gimp::UI::ColorButton.new(title, width, height, color)

title: String that will be used as title for the color_selector. width: Width of the colorpreview in pixels. height: Height of the colorpreview in pixels. color: An array of integer of float that holding the color (RGB or RGBA)

The length may be 3 for RGB or 4 for RGBA.

Creates a new Gimp::UI::ColorButton widget.

This returns a button with a preview showing the color. When the button is clicked a Gtk::ColorSelectionDialog is opened. If the user changes the color the new color is written into the array that was used to pass the initial color and the "color_changed" signal is emitted.

colorは3要素または4要素(α付き)の配列で、 0〜255の整数か0〜1の実数のいずれかを要素に持ちます。

Methods

Gimp::UI::ColorButton#color
Gimp::UI::ColorButton#color=
代入する際には、newに渡したcolorと同じ形式でなくてはなりません。 bppやfloat?で形式をチェックできます。
Gimp::UI::ColorButton#bpp
length of color
Gimp::UI::ColorButton#float?
色を実数で保持しているか?

Signals

Gimp::UI::ColorButton#color_changed
色が変更されたときに発生するシグナル
Last modified:2005/10/10 01:35:14
Keyword(s):
References:[Gimp::UI]