Uniface colorbox Command: A Complete Guide to Color Dialog Integration 🎨
Peter

Peter @petercode

Joined:
Jul 12, 2025

Uniface colorbox Command: A Complete Guide to Color Dialog Integration 🎨

Publish Date: Jul 13
0 0

This article was created with the assistance of AI and is based on the official Uniface Documentation 10.4.

What is the colorbox Command? 🤔

The colorbox command in Uniface is a powerful utility that launches the Microsoft Windows Color dialog box directly from your application. Whether you're building desktop applications that need color selection functionality, this command provides a seamless integration with the native Windows color picker.

Syntax Overview 📝

colorbox {/hex | /rgb} {/full} {"Color"}
Enter fullscreen mode Exit fullscreen mode

The beauty of this command lies in its simplicity and flexibility. Let's break down each component:

Qualifiers Explained 🔧

Qualifier Purpose Result
/hex Hexadecimal output Returns color as hex string (e.g., "#FF0000")
/rgb RGB output Returns color as RGB values (e.g., "255,0,0")
/full Extended dialog Shows full color picker with custom colors

Practical Examples 💡

Basic Color Selection

# Simple hex color picker starting with green
colorbox /hex "#00FF00"

# RGB color picker with green preset
colorbox /rgb "0,128,0"

# Full-featured color dialog
colorbox /hex /full "#00FF00"
Enter fullscreen mode Exit fullscreen mode

Dialog Variations 🎛️

Without the /full switch, you get a compact color dialog perfect for quick color selection. With /full, users access the complete Windows color picker including custom color creation capabilities.

Return Values & Error Handling ⚡

The command provides clear feedback through $result and $status:

  • $status = 0: User clicked OK ✅
  • $status < 0: User cancelled or closed dialog ❌
  • $result: Contains the selected color in your chosen format

Smart Color Memory 🧠

One of the most developer-friendly features is the automatic color memory. The dialog remembers the last selected color throughout the application session, making it intuitive for users who work with consistent color schemes.

Integration Tips 🚀

  • Use in Form components for optimal performance
  • Consider accessibility - the command includes testing support for screen readers
  • Choose between hex and RGB based on your application's color handling needs
  • Leverage the color memory feature for better user experience

Conclusion 🎯

The colorbox command exemplifies Uniface's philosophy of providing powerful, yet simple tools for desktop application development. Whether you're building a design tool, customization interface, or any application requiring color selection, this command offers native Windows integration with minimal code.

Ready to add some color to your Uniface applications? Give colorbox a try in your next project! 🌈


Want to learn more about Uniface development? Follow me for more insights into this powerful RAD platform!

Comments 0 total

    Add comment