Click here to monitor SSC
SQLServerCentral is supported by Redgate
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: 461 | Views in the last 30 days: 1
Related Articles

Color Themes for Power BI

Color coordination is important in report and dashboard design.  We’ve seen theming and color pallet...


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...


Colorblind Awareness and Power BI KPIs

Update: The ability to change the color of a KPI was delivered in August 2016! Color blindness, or ...


color parameter

How to creat a color parameter


Setting specific colors for PowerView charts

I was listening for Phil Collins' "True Colors" song in my car audio this morning and it reminded me...

color palette    
rgb code