By knowing the color name how can we programmatically find its red-green-blue values in Java?
By knowing the color name how can we programmatically find its red-green-blue values in
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Since you are using SWT, you may be able to use the ColorRegistry API. There are a couple of ways to get hold of prepopulated registries (
JFaceResources.getColorRegistry()andITheme.getColorRegistry()) though it is not obvious from the javadocs what colors they are prepopulated from, and where the color definitions come from.Alternatively use create a map and populate it with names based on the SWT.COLOR_XXX constants ans color values obtained by using
Display.getSystemColor(...)