Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Quantization of an RGB color code into a palette

By Federico Iori,

We have a table DIM_ESHOP_PHONE, containing a column Color_RGB in RGB Hex Format . We want to reduce the color to a given palette of colors, contained into the table DIM_COLOR . We simply associate the RGB code to the palette using the minimal cartesian 3d distance  , defined as

POWER( Power((R-Ro),2)+Power((G-Go),2)+Power((B-Bo),2) , 0.5) .

It works.

Total article views: 439 | Views in the last 30 days: 2
 
Related Articles
BLOG

Color E-Ink

I love my Kindle, but it uses an older e-ink technology that's a little slow and doesn't support col...

FORUM

color parameter

How to creat a color parameter

BLOG

Alternating Group Colors and Alternating Row Colors

Alternating Group Colors and Alternating Row Colors After posting my recent blog about Alternating ...

BLOG

Power Map Enhancements and Presentation

Power Map for Excel 2013 has had some recent enhancements that are worth noting.  You can download t...

ARTICLE

Smelly Power

Power is a limited resource, but one that's required for computing. Microsoft has a new idea for gen...

Tags
approximation    
color palette    
quantization    
rgb code    
 
Contribute

Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones
Editor, SQLServerCentral.com

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones