📄 bicolorpicker.html
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><!--Generated using api.website.xsl version 2003-07-17--><head><META http-equiv="Content-Type" content="text/html; charset=utf-8"><title>BiColorPicker</title><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><link type="text/css" rel="stylesheet" href="api.css"><script type="text/javascript"> function showDerivedClasses() { var ul = document.getElementById("api-derived-classes"); var lis = ul.childNodes; var l = lis.length; for (var i = 1; i < l; i++) lis[i].style.display = ""; lis[0].style.display = "none"; } </script></head><body><h1 id="BiColorPicker">BiColorPicker</h1><p>This dialog allows the user to select a predefined color or define his own color.</p><p>This class extends <code><a href="BiDialog.html">BiDialog</a></code> and therefore all methods and fields available for <code><a href="BiDialog.html">BiDialog</a></code> are also available for <code>BiColorPicker</code>.</p><ul class="partial-class-tree"><li><code><a href="BiObject.html">BiObject</a></code><ul><li><code><a href="BiEventTarget.html">BiEventTarget</a></code><ul><li><code><a href="BiComponent.html">BiComponent</a></code><ul><li><code><a href="BiWindow.html">BiWindow</a></code><ul><li><code><a href="BiDialog.html">BiDialog</a></code><ul><li><code>BiColorPicker</code><ul id="api-derived-classes"></ul></li></ul></li></ul></li></ul></li></ul></li></ul></li></ul><h2>Constructor</h2><p><code> new BiColorPicker()</code></p><h3>Parameters</h3><p>No parameters.</p><h2>Properties</h2><table><thead><tr><td>Name</td><td>Type</td><td class="get-header">get</td><td class="set-header">set</td><td>Descripton</td></tr></thead><tbody><tr><td><a name="hsl"></a><code>hsl</code></td><td><code class="type">Object</code></td><td class="get-column"><img src="check.png" alt="checked"></td><td class="set-column"><img src="check.png" alt="checked"></td><td>The hsl triplet describing the selected color. The hsl triplet is an object with h (0 - 360), s (0 - 1) and l (0 - 1) fields</td></tr><tr><td><a name="rgb"></a><code>rgb</code></td><td><code class="type">Object</code></td><td class="get-column"><img src="check.png" alt="checked"></td><td class="set-column"><img src="check.png" alt="checked"></td><td>The rgb triplet describing the selected color. The rgb triplet is an object with r (0 - 255), g (0 - 255) and b (0 - 255) fields</td></tr><tr><td><a name="rgbString"></a><code>rgbString</code></td><td><code class="type">String</code></td><td class="get-column"><img src="check.png" alt="checked"></td><td class="set-column"><img src="check.png" alt="checked"></td><td>The rgb string (<code>"rgb(255,255,255)"</code>) describing the selected color.</td></tr><tr><td><a name="stringBundle"></a><code>stringBundle</code></td><td><code class="type"> <code><a href="BiStringBundle.html">BiStringBundle</a></code> </code></td><td class="get-column"><img src="check.png" alt="checked"></td><td class="set-column"><img src="check.png" alt="checked"></td><td>The string bundle to use for this color picker. If this is set to <code>null</code> then the static string bundle for<code><a href="BiColorPicker.html">BiColorPicker</a></code> is used</td></tr></tbody></table><h2>Methods</h2><p>None.</p><h2>Events</h2><table><thead><tr><td>Name</td><td>Type</td><td class="bubbles-header">Bubbles</td><td>Descripton</td></tr></thead><tbody><tr><td><a name="change"></a><code>change</code></td><td><code class="type"> <code><a href="BiEvent.html">BiEvent</a></code> </code></td><td class="bubbles-column"></td><td>This event fires continiously when the user changes the color. If you want to know when the user closes the dialog use the <code><a href="BiDialog.html#dialogresult">dialogresult</a></code> event inherited from the <code><a href="BiDialog.html">BiDialog</a></code>.</td></tr></tbody></table><h2>Static Methods</h2><table><thead><tr><td>Name</td><td>Description</td></tr></thead><tbody><tr><td><code><a href="#getRgbFromRgbString">getRgbFromRgbString</a></code></td><td>This returns an rgb object from an rgb string (<code>"rgb(255,255,255)"</code>)</td></tr><tr><td><code><a href="#getRgbStringFromRgb">getRgbStringFromRgb</a></code></td><td>This returns an rgb string (<code>"rgb(255,255,255)"</code>) from an rgb object</td></tr><tr><td><code><a href="#hslToRgb">hslToRgb</a></code></td><td>This takes an hsl object with h (0 - 360), s (0 - 1) and l (0 - 1) fields and returns an rgb object with r (0 - 255), g (0 - 255) and b (0 - 255) fields.</td></tr><tr><td><code><a href="#rgbToHsl">rgbToHsl</a></code></td><td>This takes an rgb object with r (0 - 255), g (0 - 255) and b (0 - 255) fields and returns an hsl object with h (0 - 360), s (0 - 1) and l (0 - 1) fields.</td></tr></tbody></table><h2>Static Fields</h2><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td><code>BRIGHTNESS_HANDLE_IMAGE_URI</code></td><td><code class="type">String</code></td><td>The URI to the image to use as the handle for the brightness</td></tr><tr><td><code>BRIGHTNESS_IMAGE_URI</code></td><td><code class="type">String</code></td><td>The URI to the image to use as the image for the brightness</td></tr><tr><td><code>HUE_SATURATION_HANDLE_IMAGE_URI</code></td><td><code class="type">String</code></td><td>The URI to the image to use as the handle for the hue saturation map</td></tr><tr><td><code>HUE_SATURATION_IMAGE_URI</code></td><td><code class="type">String</code></td><td>The URI to the image to use as the hue saturarion map</td></tr></tbody></table><h2>Remarks</h2><p>To prevent a dialog from being disposed when it is closed you can use the <code><a href="BiWindow.html#beforeclose">beforeclose</a></code> event and then prevent the default action. This prevents the window from being closed and hidden. Then you can manually hide it by setting <code><a href="BiComponent.html#visible">visible</a></code> to <code>false</code>.<br> <br> Use the <code><a href="BiDialog.html#dialogresult">dialogresult</a></code> event to get a notification when the user has selected a color. If the user canceled the dialog the <code><a href="BiDialog.html#dialogResult">dialogResult</a></code> property is set to null.<br> <br> The text for the buttons and labels are provided by a<code><a href="BiStringBundle.html">BiStringBundle</a></code> and the following keys are used:<br> <br> ColorPickerCaption - The text to use for the dialog caption<br> ColorPickerOK<br> ColorPickerCancel<br> ColorPickerHue - The label next to the hue input<br> ColorPickerSat<br> ColorPickerLum<br> ColorPickerRed<br> ColorPickerGreen<br> ColorPickerBlue<br> ColorPickerSelectedColor - The label next to the selected color<br> </p><h2>Static Method Details</h2><h3><a name="getRgbFromRgbString"></a>getRgbFromRgbString</h3><p>This returns an rgb object from an rgb string (<code>"rgb(255,255,255)"</code>)</p><h4>Syntax</h4><pre class="method-syntax">BiColorPicker.getRgbFromRgbString(<span class="methodArgument">s</span>)</pre><h4>Parameters</h4><table><thead><tr><td>Name</td><td>Type</td><td class="optional-header">Optional</td><td>Default</td><td>Descripton</td></tr></thead><tbody><tr><td><code>s</code></td><td><code class="type">String</code></td><td class="optional-column"></td><td></td><td>An rgb string</td></tr></tbody></table><h4>Return Type</h4><p><code class="type">Object</code></p><h3><a name="getRgbStringFromRgb"></a>getRgbStringFromRgb</h3><p>This returns an rgb string (<code>"rgb(255,255,255)"</code>) from an rgb object</p><h4>Syntax</h4><pre class="method-syntax">BiColorPicker.getRgbStringFromRgb(<span class="methodArgument">rgb</span>)</pre><h4>Parameters</h4><table><thead><tr><td>Name</td><td>Type</td><td class="optional-header">Optional</td><td>Default</td><td>Descripton</td></tr></thead><tbody><tr><td><code>rgb</code></td><td><code class="type">Object</code></td><td class="optional-column"></td><td></td><td>An object describing the rgb triplet</td></tr></tbody></table><h4>Return Type</h4><p><code class="type">String</code></p><h3><a name="hslToRgb"></a>hslToRgb</h3><p>This takes an hsl object with h (0 - 360), s (0 - 1) and l (0 - 1) fields and returns an rgb object with r (0 - 255), g (0 - 255) and b (0 - 255) fields.</p><h4>Syntax</h4><pre class="method-syntax">BiColorPicker.hslToRgb(<span class="methodArgument">hsl</span>)</pre><h4>Parameters</h4><table><thead><tr><td>Name</td><td>Type</td><td class="optional-header">Optional</td><td>Default</td><td>Descripton</td></tr></thead><tbody><tr><td><code>hsl</code></td><td><code class="type">Object</code></td><td class="optional-column"></td><td></td><td>An object describing the hsl triplet</td></tr></tbody></table><h4>Return Type</h4><p><code class="type">Object</code></p><h3><a name="rgbToHsl"></a>rgbToHsl</h3><p>This takes an rgb object with r (0 - 255), g (0 - 255) and b (0 - 255) fields and returns an hsl object with h (0 - 360), s (0 - 1) and l (0 - 1) fields.</p><h4>Syntax</h4><pre class="method-syntax">BiColorPicker.rgbToHsl(<span class="methodArgument">rgb</span>)</pre><h4>Parameters</h4><table><thead><tr><td>Name</td><td>Type</td><td class="optional-header">Optional</td><td>Default</td><td>Descripton</td></tr></thead><tbody><tr><td><code>rgb</code></td><td><code class="type">Object</code></td><td class="optional-column"></td><td></td><td>An object describing the rgb triplet</td></tr></tbody></table><h4>Return Type</h4><p><code class="type">Object</code></p></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -