Color Converter

Content Type: Module
Categories:

Overview

This module provides a set of reusable Java and JavaScript actions to easily convert colors from one format into another. It supports conversions between Hex codes, RGB and RGBA values.

Documentation

Demo urlhttps://colorconverter-sandbox.mxapps.io/

Color Converter

Description

This module provides a set of reusable Java and JavaScript actions to easily convert colors from one format into another. It supports conversions between Hex codes, RGB and RGBA values.

Typical usage scenario

Typically, you will need this module whenever you are working with colors in your Mendix application and are storing these in an attribute somewhere. It gives more flexibility in the development of your application and allows you to more easily use other modules and/or widgets that might expect a certain format for your Color. Using more advanced JS code or widgets, you might even use the output of the Color conversion actions in your CSS/SCSS styling.

Features and limitations

Features

The Color Converter module provides a set of reusable Java and JavaScript actions. The following actions are supported:

  • Hex code to RGB: This action converts a hex code into RGB format. The hex code inputted should adhere to the format: "#FFFFFF", while the output will be a String in the format: "rgb(255,255,255)".
  • Hex code to RGBA: This action converts a hex code into RGBA format, based on the specified Alpha. The hex code inputted should adhere to the format: "#FFFFFF" and the Alpha should be a value between 0 and 1, while the output will be a String in the format: "rgba(255,255,255,1)".
  • RGB to Hex: This action converts a RGB code into a hex code. The RGB inputted should adhere to the format: "rgb(255,255,255)", while the output will be a String in the format: "#FFFFFF".
  • RGB to RGBA: This action converts a RGB code into a RGBA code, based on the specified Alpha. The RGB inputted should adhere to the format: "rgb(255,255,255)" and the Alpha should be a value between 0 and 1, while the output will be a String in the format: "rgba(255,255,255,1)".
  • RGBA to Hex: This action converts a RGBA code into a Hex code. The RGBA inputted should adhere to the format: "rgba(255,255,255,1)", while the output will be a String in the format: "#FFFFFF".
  • RGBA to RGB: This action converts a RGBA code into a RGB code. The RGBA inputted should adhere to the format: "rgba(255,255,255,1)", while the output will be a String in the format: "rgb(255,255,255)".

Limitations

  • The module supports conversions between Hex codes, RGB and RGBA values. Any other color formats are currently not supported.

Dependencies

  • None

Installation

  • Download the module from the Marketplace and import it into your project.
  • Use the actions in the _UseMe folder in your microflows or nanoflows to easily convert your color value into a different format. Simply drag and drop the activities in your logic and provide the correct input(s).

Configuration

  • Each action takes one or more input values and returns a string with the newly formatted color. The documentation of each action lists the appropriate input and output formats.

Bugs

  • No currently known bugs.

Releases

Version: 1.0.0
Framework Version: 8.18.1
Release Notes: Initial release of the module, based on Mendix version 8.18.1. It provides: - Six Java actions to convert colors between Hex codes, RGB and RGBA format - to be used in Microflows. - Six JavaScript actions to convert colors between Hex codes, RGB and RGBA format - to be used in Nanoflows.