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: 460 | Views in the last 30 days: 2
 
Related Articles
BLOG

Color Themes for Power BI

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

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

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

BLOG

Alternating Group Colors and Alternating Row Colors

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

Tags
approximation    
color palette    
quantization    
rgb code    
 
Contribute