Skip to Main Content
Construct 3 suggestions 21H2 - ARCHIVED

This suggestions platform is now closed and will be shut down on March 1st 2024.

Please ensure any content you care about is backed up before that date.

Feature requests are now handled on GitHub here: https://github.com/Scirra/Construct-feature-requests

11 VOTE
Categories Runtime
Created by Guest
Created on Jul 26, 2021

ColorFromHex() and ColorFromString()

rgba() and rgbEx() functions are good when accessing a color channel-by-channel.

A lot of the time I need to store hardcoded colors (e.g. Player1/2/3 colors, which are hardcoded because the designer requires a specific palette) in variables/array, and copy-pasting all these Rs, Gs and Bs is tedious. I need to retrieve them 1 by 1 from the array too.

Please add a function that returns a color from Hex string (e.g. "ffffffff"), or an rgba string (e.g. "100,100,123,0"), so they are easier to store and retrieve.


Why choose this idea?

  1. Colors are needed in many situations: highlighting, color coding the UI, enable/disable, shadowing, vfx, DrawingCanvas...

  2. Simple to implement.

  3. Hex is used in CSS (which C3 supports), so it would be more modular to keep all my colors in one format across the project.

  4. Less variables and more compact data when dealing with colors.


Thank you.

  • Attach files
  • +6