Fontcolor

Set the text color and/or text background color.

Select some text and click the 'Text color' button on the toolbar.

Code

<!DOCTYPE html>
<html>
    <head>
        <title>Redactor X</title>
        <meta charset="utf-8">

        <!-- css -->
        <link rel="stylesheet" href="/your-folder/redactorx.css" />
    </head>
    <body>
        <!-- element -->
        <textarea id="entry">...</textarea>

        <!-- js -->
        <script src="/your-folder/redactorx.js"></script>
        <script src="/your-folder/plugins/fontcolor.js"></script>

        <!-- call -->
        <script>
        RedactorX('#entry', {
            plugins: ['fontcolor']
        });
        </script>
    </body>
</html>

Usage

By default, the plugin already has a set of colors installed. You can set your own set of colors this way:

RedactorX('#entry', {
    plugins: ['inlineformat'],
    fontcolor: {
        gray: ['#212529', '#343a40', '#495057', '#868e96', '#adb5bd', '#ced4da', '#dee2e6', '#e9ecef', '#f1f3f5', '#f8f9fa'],
        red:  ["#c92a2a", "#e03131", "#f03e3e", "#fa5252", "#ff6b6b", "#ff8787", "#ffa8a8", "#ffc9c9", "#ffe3e3", "#fff5f5"]
    }
});