Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7514971
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T00:39:11+00:00 2026-05-30T00:39:11+00:00

I wish to convert a Color Object into a human readable String. To clarify

  • 0

I wish to convert a Color Object into a human readable String.

To clarify I’m just looking for a conversion of the Class’s static variables.

eg.

  1. Color.YELLOW -> “yellow”
  2. Color.RED -> “red”
Color red = Color.RED;
System.out.println(red.conversionMethod());

I want an output of “red”

Thank you in advance for your help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T00:39:13+00:00Added an answer on May 30, 2026 at 12:39 am

    Get use of Java reflection. This code gives useful output. You can remove unwanted ones from ArrayList via something like list.remove("BITMASK");

    import java.awt.Color;
    import java.lang.reflect.Field;
    import java.util.ArrayList;
    
    public class Test
    {
        public static void main ( String [] args )
        {
            Field [] names = Color.class.getFields();
            ArrayList < String > list = new ArrayList < String >();
    
            for ( Field name: names )
                list.add( name.getName() );
            for ( int i = 0; i < list.size(); i++ )
                System.out.println( list.get( i ) );
        }
    }
    

    Output:

    white WHITE lightGray LIGHT_GRAY gray GRAY darkGray DARK_GRAY black
    BLACK red RED pink PINK orange ORANGE yellow YELLOW green GREEN
    magenta MAGENTA cyan CYAN blue BLUE OPAQUE BITMASK TRANSLUCENT

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wish to convert a single string with multiple delimiters into a key=>value hash
I wish to convert a string to md5 and to base64. Here's what I
I have a txt(ascii) file but i wish to convert this file into binary
I am pretty new to CSS and I wish to convert this table into
I have a list of String which I wish to convert to Json. I
I am a java devloper and I wish to convert following code to java
I wish to implement a 2d bit map class in Python. The class would
I have a tinyint column in the database and I wish to convert it
How would I convert the following code to C# DecimalFormat form String pattern =
Very simple question here. I have a double that I wish to convert back

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.