# # inline-color-picker components

The `inline-color-picker` component displays a rectangular box on the UI, from where a user clicks to bring up a color picker palette and select colors.

Note: `inline-color-picker` currently is only used for the "fv--comparison-select-pdf-file-dialog".

## # Code examples

The following example shows the basic usage of the `inline-color-picker` component:

    <html>
        <template id="layout-template">
            <webpdf>
                <toolbar>
                    <group-list shrink-size="0">
                        <group name="home-tab-group-hand">
                            <hand-ribbon-button></hand-ribbon-button>
                            <open-file-ribbon-dropdown></open-file-ribbon-dropdown>
                            <download-file-ribbon-button></download-file-ribbon-button>
                            <form-group label="Select color">
                                <inline-color-picker></inline-color-picker>
                            </form-group>
                        </group>
                    </group-list>
                </toolbar>
                <div class="fv__ui-body">
                    <viewer></viewer>
                </div>
            </webpdf>
        </template>
    </html>
    <style>

    </style>
    <script>
        var CustomAppearance = UIExtension.appearances.Appearance.extend({
            getLayoutTemplate: function() {
                return document.getElementById('layout-template').innerHTML;
            },
            disableAll: function(){}
        });
        var libPath = window.top.location.origin + '/lib';
        var pdfui = new UIExtension.PDFUI({
                viewerOptions: {
                    libPath: libPath,
                    jr: {
                        licenseSN: licenseSN,
                        licenseKey: licenseKey
                    }
                },
                renderTo: document.body,
                appearance: CustomAppearance,
                addons: []
        });
    </script>

    {
        "iframeOptions": {
            "style": "height: 300px"
        }
    }

Set the current color displayed on the rectangle by using API:

    <html>
        <template id="layout-template">
            <webpdf>
                <toolbar>
                    <group-list shrink-size="0">
                        <group name="home-tab-group-hand" @var.grp="$component">
                            <hand-ribbon-button></hand-ribbon-button>
                            <open-file-ribbon-dropdown></open-file-ribbon-dropdown>
                            <download-file-ribbon-button></download-file-ribbon-button>
                            <form-group label="Select color">
                                <inline-color-picker @init="grp.colorPicker=$component"></inline-color-picker>
                            </form-group>
                            <ribbon-button @on.click="grp.colorPicker.setValue(Math.floor(Math.random() * 0xFFFFFF))" text="Set a random color"></ribbon-button>
                        </group>
                    </group-list>
                </toolbar>
                <div class="fv__ui-body">
                    <viewer></viewer>
                </div>
            </webpdf>
        </template>
    </html>
    <style>

    </style>
    <script>
        var CustomAppearance = UIExtension.appearances.Appearance.extend({
            getLayoutTemplate: function() {
                return document.getElementById('layout-template').innerHTML;
            },
            disableAll: function(){}
        });
        var libPath = window.top.location.origin + '/lib';
        var pdfui = new UIExtension.PDFUI({
                viewerOptions: {
                    libPath: libPath,
                    jr: {
                        licenseSN: licenseSN,
                        licenseKey: licenseKey
                    }
                },
                renderTo: document.body,
                appearance: CustomAppearance,
                addons: []
        });
    </script>

    {
        "iframeOptions": {
            "style": "height: 300px"
        }
    }

## # API

### # inline-color-picker component templates

    <inline-color-picker></inline-color-picker>

### # Methods

Methods | Description | Version
--- | --- | ---
`setValue(color: number|Color)` | Sets the current color value | 8.5.0
`getValue(): Color` | Gets the current color value | 8.5.0

### # Event

Name | Description | Example | Version
--- | --- | --- | ---
`change` | Triggered when the user selects a color | `inlineColorPicker.on('change', (color) => {})` | 8.5.0