Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IDS on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

CDF to RGB 1

Status
Not open for further replies.

csbk

Automotive
Oct 27, 2002
26
How does the color values in NX Color Definition File relate to Red Green Blue value in other programs? How do I convert RGB to CDF?

Ex.
CDF
Light Cyan Teal 0.2000000 1.0000000 0.8000000

RGB
Light Cyan-Teal 51 255 204

 
Replies continue below

Recommended for you

Why not edit a color that you don't use very often to match the RGB values you're wanting? Preferences -> Visualization -> Color Palette tab -> [Select color you want to change] -> Edit Color button -> [Enter RGB values] -> OK. When finished, you can save as a new CDF file.

No need to know how to convert when you can let the software do it for you.

Tim Flater
Senior Designer
Enkei America, Inc.
 
The CDF file is a percentage factor of the RGB values.
RGB range is 0 to 255.
CDF range is 0 to 1.

CDF RGB
.2 50
1 255
.8 204




"Wildfires are dangerous, hard to control, and economically catastrophic."

Ben Loosli
Sr IS Technologist
L-3 Communications
 
Tim,

This is a good question. I think you will run into people here that will do some very geeky things. And this is one example. Some image software will let you pick a color from a photo and it will assign a RGB value. I could, in theory, take a picture of a common material and extract the average color then apply to my CAD product with out studio. Another idea is to change my colors in NX and assign common established names. I can also use excel to generate Dim, Bright, and Grayscale versions of current colors. I keep trying to find ways to waste time I don’t have.

Every time you think, you weaken the nation.
Moe, of the Three Stooges.
 
csbk,

You think what is a good question?

My response was based on what I thought might work for you. Sorry if you felt I was questioning your reasons for doing what you asked, because I'm not sure why you felt you owed me an explanation although it is appreciated.

Regardless, either method would end with the same result: a modified CDF file with user-defined RGB values (or percentages if editing the CDF file). In the end, to me, it doesn't really matter who's right, wrong, or uses the best method. As long as the person needing help gets it, that's what counts...in my opinion.

Take care.

Tim Flater
Senior Designer
Enkei America, Inc.
 
Tim,
I enjoy your responses in this news group. My response was just to have an opportunity to explain what I was up to, and to do a little joking. The funny quote I used was for me and not to you. I was making fun of myself because as a product designer I should have more important things to do than play with the cdf.

I am though, trying to solve a common complaint. Apparently the standard colors in nx2 seemed to be more vivid to users and they liked them better. When I set up some defaults at our place for nx3, I had the concept that we would keep the nx3 color palette but run a program that would convert the object colors to the new nx3 palette placement of the same color. I am finding that the colors are not the same and the users notice this and do not like it.
 
csbk,

Thanks....I just try to help out other users. I can still remember what it was like trying to get a feel for NX when I first started using it, so I can still relate to what it's like when working with NX for the first few years.

I believe the NX2 .cdf file is still included with NX in the [path to NX installation directory]\UGII directory, if you feel that using it might be the answer. Just open the Customer Defaults and set NX to point to the directory with the CDF file.

Tim Flater
Senior Designer
Enkei America, Inc.
 
Remember, there is a different between vivid and something that actually looks good. If you open up the full list of colors in the Preferences/Visualization dialog you will see that the 216 colors form a 6 x 6 x 6 'cube'. Now the so called fully-saturated colors are at the 8 corners of the cube. In the old system (pre-NX 3) the default was, except for Black, that these were the colors in the first 7 spots with the next 7 being occupied by the tertiary colors. Now those colors are dispersed among the 216 slots where they belong.

Now as to what constitutes a ‘good color’ depends somewhat on what it is you’re modeling or at least how you’re working. If you are creating complex surfaces (and even a cylinder or a sphere will count in this case) and you work with shading on almost all of the time, than you should try to avoid using the corner colors. Now those were actually very good colors back when we only had wireframe displays and if you were only working in wireframe display today or were only drawing curves, they would still be a good choice, but not for a shaded body, particularly if there is any bit of curvature to the faces. The problem is that the fully-saturated colors are just that, full-saturated, which means that they contain ONLY the pure color, say RED or BLUE or GREEN. However, they don’t do well with a shaded model of a curved surface since there is no amount of ‘WHITE’ in the color, and it’s the ‘WHITE’ component of a color that allows highlights to be seen on a curved face thus allowing more of the ‘shape’ of the face to be seen and ‘felt’ by the user. Try it yourself.

Create two solid bodies, say something as simple as a couple of spheres, and assign to one the color RED (color 186) and the other, say something very close, like RED RED ORANGE (color 150) or RED RED PINK (color 185) or even DARK HARD RED (color 192) (each of these colors are just ONE slot away from the RED corner of the ‘cube’). Now rotate the shaded image around and look at the spheres. Note that while there is a ‘hot spot’ on the RED sphere, that it is not as pronounced or as striking as it is on the sphere using one of the ‘near-RED’ colors. And if you move further from the corners of the cube this pronouncement will become even greater. Now try this on a surface with a lot of sharp changes in curvature or something with fine detail including blends and small holes or bosses.

And before anyone thinks that our choice of colors was arbitrary or that the naming convention we came up with was somehow strange or that a ‘color cube’ was a bit unconventional, please understand that we did NOT, as much as we would like to claim, invent this scheme. Note that I was the product manager for the original color update project that was actually implemented in UG V17.0, just that we waited until NX 3 to ‘shove it down’ everyone’s throats ;-) and not just because we were scared that users wouldn't accept it, but because it took that long to uncode the many places in UG/NX where color was hard-coded and did not depend on the CDF file, which has been part of UG/NX ever since we supported color, wireframe or otherwise. It was just with the original 7 and then the eventual 14 colors, we got away with it since most people just accepted the colors as is, but once we let the cat of the bag with 216 and since we wanted to move them to where they belonged, we needed to make some changes before we could expect everything and every user to at least be able to use the new preferred scheme.

So where did this all come from? If came from a website that was set up to provide support and services for people designing websites, primarily with respect to the use of came to be known as 'web-safe' colors, so that they would look pleasing and be easy to tell apart (sound familiar?).

The primary website for this service is:


But if you want to see the exact source for our 216 colors, and their names, go to:


Anyway, I hope this helps and sorry for the long-winded post.


John R. Baker, P.E.
Product "Evangelist"
NX Product Line
UGS Corp
Cypress, CA
 
I had a major project with color from pre NX3 colors to using NX3 colors and put together a list of pre NX3 colors mapped to the NX3 colors.


Actually I created a library (dll) that you sent the name of a color and returned the closest color number located in the file. Since you can have any color pallet you want writing a program to create a green this or a yellow that was very difficult using color numbers.

PLM Exchange
 
If you can complie a GRIP program, copy and paste the text below into the editor and compile and link it. This program will automatically reassign the proper color number so that you can use the NX 3 CDF and have your old parts look correct;


$$
$$ Program to change the colors of objects created
$$ with pre-NX 3 colors to the proper NX 3 colors.
$$ It only looks for the original 15 colors as candidates
$$ for changes and leaves unchanged all others.
$$ The program will update the color of Points, Lines,
$$ Circles, Conics, B-Curves, CSYS, Planes, Solid Bodies,
$$ Sheet Bodies, Datum Axis and Datum Planes. It does
$$ NOT change the color of components in an assembly nor
$$ the faces of bodies that have been edited.
$$
$$ Written by: John R. Baker, P.E.
$$ UGS Corp.
$$ Cypress, CA
$$ John.R.Baker@ugs.com
$$
$$ Revision History
$$
$$ Created: 12 April, 2005 JRB
$$ Updated:
$$
$$


NUMBER/COL(15),EC
ENTITY/ENT

$$ Define color conversions

COL(1)=211
COL(2)=36
COL(3)=31
COL(4)=186
COL(5)=181
COL(6)=6
COL(7)=1
COL(8)=95
COL(9)=112
COL(10)=124
COL(11)=78
COL(12)=202
COL(13)=198
COL(14)=100
COL(15)=130

$$ Initialize database and set mask for valid objects

INEXTE/ALL
MASK/2,3,5,6,9,45,46,70,196,197

$$ Cycle database

S1:

ENT=NEXTE/IFEND,END1:

$$ Read existing color

EC=&COLOR(ENT)

$$ Decide if the color is a proper candidate (one of the 15)

IF/EC-15,,,S1:

$$ Replace old color assignment with a new one

&COLOR(ENT)=COL(EC)

JUMP/S1:

END1:

MASK/ALL

HALT



John R. Baker, P.E.
Product "Evangelist"
NX Product Line
UGS Corp
Cypress, CA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor