新規作成  編集  Ruby-GNOME2 Project Website  ページ一覧  検索  更新履歴  編集履歴  RSS  ログイン

Gtk::ColorSelection

Gtk::ColorSelection クラス

Gtk::ColorSelectionは、色を選択してもらうために使うウィジェットです。このウィジェットは、色相環と、色相・彩度・明度・色を表す値・RGB値・透明度を個別に表示・操作するためのスライダーやエントリーボックスなどから成っています。このウィジェットは標準の色選択ダイアログであるGtk::ColorSelectionDialogでも使われています。

GTK+3の最新バージョンではクラス自体が使用非推奨となっているようですが、Ruby/GTK3では代わりのクラスとなるGtk::ColorChooser?系のクラスがまだ実装されていないようです

インクルードされているモジュール

  • Gtk::Buildable?
  • Atk::Implementor
  • GLib::Interface?

クラスメソッド

Gtk::ColorSelection.new
Creates a new Gtk::ColorSelection.
Gtk::ColorSelection.palette_from_string(str)
Parses aColor.parse.
  • str: a string encoding a color palette.
  • Returns: return an array of Gdk::Color or nil.
Gtk::ColorSelection.palette_from_string("#6633ff:red:green")
Gtk::ColorSelection.palette_to_string(colors)
Encodes a palette as a string, useful for persistent storage.
  • colors: an array of colors(Gdk::Color).
  • Returns: allocated string encoding the palette. color palette string; the string is a colon-separated list of color names readable by Gdk::
Gtk::ColorSelection.set_change_palette_hook()
要編集

インスタンスメソッド

has_opacity_control?
Determines whether the colorsel has an opacity control.
  • Returns: true if the colorsel has an opacity control. false if it does't.
has_opacity_control=(has_opacity)
Sets the colorsel to use or not use opacity.
  • has_opacity: true if colorsel can set the opacity, false otherwise.
  • Returns: has_opacity
set_has_opacity_control(has_opacity)
Same as Gtk::ColorSelection#has_opacity_control=.
  • has_opacity: true if colorsel can set the opacity, false otherwise.
  • Returns: self
has_palette?
Determines whether the color selector has a color palette.
  • Returns: true if the selector has a palette. false if it hasn't.
has_palette=(has_palette)
Shows and hides the palette based upon the value of has_palette.
  • has_palette: true if palette is to be visible, false otherwise.
  • Returns: has_palette
set_has_palette(has_palette)
Same as Gtk::ColorSelection#has_palette=.
  • has_palette: true if palette is to be visible, false otherwise.
  • Returns: self
current_alpha
Returns the maximum number of palette colors.
  • Returns: the maximum number of palette indexes.
current_alpha=(alpha)
Sets the current opacity to be alpha. The first time this is called, it will also set the original opacity to be alpha too.
  • alpha: an integer between 0 and 65535.
  • Returns: alpha
set_current_alpha(alpha)
Same as Gtk::ColorSelection#current_alpha=.
  • alpha: an integer between 0 and 65535.
  • Returns: self
current_color
Sets color to be the current color in the Gtk::ColorSelection widget.
  • Returns: a Gdk::Color to fill in with the current color.
current_color=(color)
Sets the current color to be color. The first time this is called, it will also set the original color to be color too.
  • color: A Gdk::Color to set the current color with.
  • Returns: color
set_current_color(color)
Same as Gtk::ColorSelection#current_color=.
  • color: A Gdk::Color to set the current color with.
  • Returns: self
previous_alpha
Returns the previous alpha value.
  • Returns: an integer between 0 and 65535.
previous_alpha=(alpha)
Sets the 'previous' alpha to be alpha. This method should be called with some hesitations, as it might seem confusing to have that alpha change.
  • alpha: an integer between 0 and 65535.
  • Returns: alpha
set_previous_alpha(alpha)
Same as Gtk::ColorSelection#previous_alpha=.
  • alpha: an integer between 0 and 65535.
  • Returns: self
previous_color
Fills color in with the original color value.
  • Returns: a Gdk::Color to fill in with the original color value.
previous_color=(color)
Sets the 'previous' color to be color. This method should be called with some hesitations, as it might seem confusing to have that color change. Calling Gtk::ColorSelection#current_color= will also set this color the first time it is called.
  • color: a Gdk::Color to set the previous color with.
  • Returns: color
set_previous_color(color)
Same as Gtk::ColorSelection#previous_color=.
  • color: a Gdk::Color to set the previous color with.
  • Returns: self
adjusting?
Gets the current state of the colorsel.
  • Returns: true if the user is currently dragging a color around, and false if the selection has stopped.
current_rgba()

要編集

Ruby/GTK3 only

current_rgba=()

要編集

Ruby/GTK3 only

set_current_rgba()

要編集

Ruby/GTK3 only

previous_rgba()

要編集

Ruby/GTK3 only

previous_rgba=()

要編集

Ruby/GTK3 only

set_previous_rgba()

要編集

Ruby/GTK3 only

プロパティ

current-alpha: Integer (Read/Write)
The current opacity value (0 fully transparent, 65535 fully opaque)
current-color: Gdk::Color (Read/Write)
The current color
has-opacity-control: true or false (Read/Write)
Whether the color selector should allow setting opacity
has-palette: true or false (Read/Write)
Whether a palette should be used
current-rgba:

要編集

Ruby/GTK3 only

シグナル

color-changed: self
This signal is emitted when the color changes in the Gtk::ColorSelection according to its update policy.

更新履歴

  • 2014-09-07 クラスの説明文を翻訳、更新。Ruby/GTK3関連の情報を追加 - きたがわ
  • 2014-06-15 クラスのメンバで漏れていたものを追加。 - きたがわ
  • - Masao?
更新日時:2014/09/07 18:31:19
キーワード:
参照:[Gdk::Colormap] [gtk2-tut-colorsel] [Gtk::ColorSelectionDialog] [Gtk::ColorSelection] [Ruby/GTK] [Ruby/GTK Object Hierarchy]