Is it possible to alter a Color's RGB value ?

I'd like the Color references I'm using to stay referring to the same object when I change the color values. So ideally I'd like to change the RGB values of these Colors, since making new Color objects is obviously not what I want.
Neither Color nor ColorSpace have anything to offer, and googling hasn't turned up much.
I have to do it this way, because several classes all have their own reference to the Color, so creating a new Color for one reference won't change them all.
Any suggestions?

Cheers for the blog post Kirill ;o) That's a really neat trick :)
Since every inbuilt Java class I know of uses
getRGB(), this is all that's needed :o)
No worries about the Java classes you don't know of,
or whether anyone else on your project might use
"getRed()" etc? And you've ditched alpha information
too.No-one else is working on my project mate ;o) And despite your sarcasm, you are right - there aren't any worries about Java classes I 'don't know of', since the colours I'm using are only read for rendering; nothing more. Every method I have that affects the colours deal with WebColor, so that's fine. Graphics.setColor(WebColor wc) works fine too, with my 'nasty hack', as you call it. So I'm more than happy, I assure you.
If it was me doing a nasty hack like that I'd at
least override everything so it was a stable nasty
hack instead of an unstable one ;o)Well that's the difference between us then; I don't do work that I know won't be needed :D
I'm just being facetious, because I was slightly offended by your taunting tone, itchy :oP I know you're right, of course. What I've said above is true, but obviously I agree that a stable class that can be used generically is far better than my case-specific code. I'll be changing my class to kilrillg's nifty code right now :o)
Thanks again Kirill.

Similar Messages

  • Color management:  RGB values

    Working mass production with Aerial Photography. 8 bit color, scanline tifs
    Client request RGB values of light gray areas be within 5 of each other. For example: Red 130, Green 132, Blue 135.
    Need batch routine to run on 15,000 images. If it is even possible. Looking for options in CS3 or any other program.

    Most automated processes are not able to recognize which objects should be
    true gray. For example, PS's auto color or auto levels would make a blue
    lake to gray.
    I'd recommend a combined manual and batch process. The operator would
    check a known gray area on about every 100th image, convert the image to
    Lab mode, and define a set of curves that would correct the color cast.
    Then use a batch operation to apply that curve to 100 images centered on
    that image. This would take 150 manual operations.
    If the weather is constant, you may be able to increase the batch size
    considerably. By the same token, for changing sun angle, cloud cover or
    other situations that affect the color, you may need to increase the number
    of manual checks.

  • Why does my cell table not display color but RGB value

    Could somebody please suggest me.
    What I wanted is to let one collumn of a table display colors, but now they display the RGB values of the color not the colors.
    Please suggest me how I should do to get this done.
    Thanks.

    The renderer displays the toString() value of the Object stored in the table by default. If you want to display something else then you need to use a custom renderer
    The Swing tutorial on [url http://java.sun.com/docs/books/tutorial/uiswing/misc/keybinding.html]How to Use Tables explains what a renderer is and has an example that displays a color in a column.

  • Is it possible to change the color of the folders in OS 10.10.2 Yosemite?

    Is it possible to change the color of the folders in OS 10.10.2 Yosemite?

    You can try these after backing up.
    Folders – Color folders
    Folders – Color folders Mavericks
    Folders Factory – Color folders

  • Is it possible to change the color of the regions in GB 11?

    Is it possible to change the color of the regions in GB 11?

    Gourmet Pizza wrote:
    Is it possible to change the color of the regions in GB 11?
    only an imported orange region (to purple):
    http://www.bulletsandbones.com/GB/GBFAQ.html#orangetopurple
    (Let the page FULLY load. The link to your answer is at the top of your screen)

  • Is it possible to change the color of imported art in pages, say from B&W to a color?  ... or even to make it a gradation of color?

    Is it possible to change the color of imported art in pages, say from B&W to a color?  ... or even to make it a gradation of color?

    Make a Shape > Inspector > Graphic > Tinted Image Fill > Scale to fit > browse to image > click on the color patch to change the color to what you want
    or
    Drag in an image > overlay it with a Shape > select the color for the shape and change its Opacity
    Shapes may have Gradient and Advanced Gradient (multiple colors) fills both linear and radial. Both are in the Graphic Inspector as is Opacity.
    Peter

  • Is it possible to change the colors of the tabs in the pannelTabbed comp

    Hi Experts,
    Is it possible to change the colors of the tabs in the pannelTabbed component.
    suppose for the selected tab we need white color and non selected we need brown color.
    How can we achive this using ADF.
    Regards
    Gayaz

    [url http://download.oracle.com/docs/cd/E14571_01/web.1111/b31973/af_skin.htm#BAJFEFCJ]skinning

  • Is it possible to only install Color from the FCS3 suite?

    Is it possible to only install Color from the FCS3 suite? If so, what is the correct procedure?
    thanks

    I'm not sure whether you can install it on its own or whether you will need FCP as well.
    Open the installer, go through it and you will come to a page where every app and its media is listed.
    Deselect everything except Color and continue with the installation.
    If it refuses you will have to go back and select FCP as well.

  • Possibility to assign a color profile in the color management tab for more video formats

    Presently, in After Effects CS5, in the color management tab of the "Interpret Footage" dialog box the possibility to assign a color profile to footage is grayed out for many video formats.
    Formats that allow to assign a color profile include Quicktime/JPEG2000, Quicktime/Motion JPEG A, Quicktime/Motion JPEG B, Quicktime/MPEG-4, Quicktime/Animation as well as various image sequences, like tiff-sequences. (Motion JPEG A,B and Quicktime/MPEG-4 are not very helpful in this context because they have a small color shift when reimported to After Effects.)
    Formats that do not allow to assign a color profile include Quicktime/PhotoJPEG, Quicktime/H264, H264 main concept, DVCPRO HD 1080p30, F4V. (Here, H264 main concept has anyway the disadvantage that it has a color shift when reimported into After Effects.)
    In After Effects CS4 it was possible to assign a color profile to Quicktime/H264, Quicktime/PhotoJPEG, DVCPRO HD 1080p30, but in CS5 this is no longer possible.
    Those video formats that do not allow to assign a color profile automatically are interpreted as having the color profile HDTV (Rec. 709) Y'CbCr in case that the videos have 1920x1080 format; similar applies to PAL formats which get SDTV (Rec. 709) Y'CbCr color profile.
    (I did not find anything of this automatic assignment to HDTV or SDTV color profile in the "interpretation rules.txt" file, therefore it must be written into the programme itself.)
    With growing popularity of wide gamut monitors it becomes necessary to produce footage and other videos that have a color profile different from HDTV or sRGB. When such footage is reimported to After Effects it has the wrong color and the only workarounds are either to use (in After Effects) the effect "Color profile converter" which necessitates extra render time or to use somewhat unpopular formats, like JPEG2000 that has very large filesize.
    Presently many footage is produced in Quicktime/PhotoJPEG and therefore it would be very desirable to allow to assign a color profile to such footage in the color management tab of the "Interpret Footage" dialog box.
    Does anyone know why in AE CS5 the video formats Quicktime/PhotoJPEG and Quicktime/H264 do not allow to have an arbitrary color profile assigned (although it was possible in CS4), is it a bug, or does it have a deeper reason.
    In this context I have a related question, often I read that Quicktime videos have a gamma tag. Does this mean that part of the color profile (the gamma value) is actually embedded/remembered, like you have it for images where the gamma is part the embedded color profile.
    I use AE CS5 on Mac Pro 2009 with OS 10.6.7.
    Thanks,
    Volker

    Thank you Rick for this interesting explanations and the links to articles.
    In the past few days I performed a few tests in After Effects and it is interesting that you mention that cameras, like the Sony EX3, allow videos to have embedded color profiles. I am not working myself with cameras but either get footage from the internet or sometimes videos from our video department which produces videos with professional SONY cameras, usually I get them in a matrox mxf format.
    As far as my test with After Effects show it is not possible to embed color profiles in the videos rendered with After Effects. Independent of the color profile in the working space and independent from the color profile in the output module I always get the same reaction if I reimport videos rendered by After Effects back to After Effects:
    In AE CS5 videos made in the formats Quicktime/PhotoJPEG, Quicktime/H264, H264 main concept, DVCPRO HD 1080p30, F4V  are always interpreted as color profile SDTV/HDTV (Rec. 709) Y'CbCr (even if I made them in other color profiles, such as Adobe RGB, Photo RGB, sRGB); and there is no possibility to change this interpretation rule.
    In contrast videos made in the formats Quicktime/JPEG2000, Quicktime/Motion JPEG A, Quicktime/Motion JPEG B, Quicktime/MPEG-4, Quicktime/Animation are always interpreted as sRGB (even if if I made them in other color profiles, such as Adobe RGB, Photo RGB, HDTV); only this time I can change the interpretation rule. Therefore if I know for example that if I had selected Photo RGB in the Output module I can change after the reimport the interpretation rule from sRGB to Photo RGB and only then I get again the original colors.
    The only exceptions are picture sequences, such as tiff-sequences, where the original color profile is automatically selected in the interpretation of the footage.
    Therefore, unfortunately for videos produced by After Effects your advice "If it says something like sRGB and you can change it, in most cases you shouldn't change it because the guess is probably right. If there is no color profile assigned then you should assume that is correct." is not so easy to be applied. You have to know how you did it originally in the Output module and hope that you can change it to the proper color profile, in case that the original color profile in the Output module was different from sRGB and HDTV/SDTV. But it is interesting to hear from you that with cameras there seem to be more possibilities.
    For this reason it would be nice if in future versions of After Effects one could change the color profile in the the color management tab of the "Interpret Footage" dialog box also for formats such as Quicktime/PhotoJPEG, Quicktime/H264, H264 main concept, DVCPRO HD 1080p30, F4V.
    Of course one can always circumvent shortcomings by using tiff-sequences, QT/jpeg2000, or QT/Animation as formats for storing, which is anyway better for lossless or nearly lossless storing, but the files are then too large and also cannot be played easily with a player.
    Volker

  • Re: Is it possible to change row colors on array fields ors

    HI Martin!
    Yes, it is possible to change row colors on array fields.
    I have attached a PEX (tools.pex) which has an object which changes FillColor
    and PenColor for Arrays. The PEX has it's own test window, so you can try
    various combinations. (There are a few other Objects in the Project which are
    not relevant
    I'm not sure that you can change colors on individual choices in a scroll list.
    I haven't tried playing around with it.
    The test window actually changes the color of scroll lists as well.
    The object keeps track of which rows have changed color, same with pen color, so
    that when you scroll it keeps track of which rows are a different colors.
    The pex is self-contained, just import the file and do a test run.
    Please let me know if you have any problems.
    -later
    -labeaux
    Is it possible to change row colors on array fields or scroll lists?
    I need to create a list field that will allow me to dynamically change the
    fillColor and/or penColor attributes of individual rows. (I just want to
    highlight the rows, and those seem to be the obvious attributes...) It appears
    you can't do that on scroll lists (the elements are list elements, and don't
    have those attributes) and I can't figure out how to do it on an array field
    either. Any ideas for how to accomplish this?
    -Martin ([email protected])

    FreshWebmuse,
    Version 2 of iCal has the "Group Calendar" feature. It was released as part of Mac OS X v10.4, and if you really want/need that feature you will have to upgrade to Tiger.
    ;~)

  • Flex Hero - Proper way to alter style/color

    Surely there is an easy way to alter the color of the View...or specifically the Header/ActionBar at the top.
    For example, like I see on this site:
    http://thoughtfaqtory.com/blog/2010/11/10/adobe-flex-mobile-overview-part-1/
    I'd like to be able to alter the background colors to something other then the default black.  Must I create a new skin for this?
    Darren

    I tried setting that in the "design" editor and didn't see any change...so I never thought of trying that.
    Setting it directly in the mxml code on the MobileApplication object made the change.
    Thanks,
    Darren

  • Is it Possible to Save Custom Colors

    Hello
    I am interested in using some colors that are not part of any of the pre-loaded selections. Is it possible to create a color with the color wheel and then save it? I want to be able to use the same color on many parts of the site without having to recreate it every time.
    Thanks for the help!

    In the color window, click on the magnifying glass to the left of the color swatch box. Now click on your color and it will appear in the swatch box. Drag this color down to one of the little squares at the bottom of the window.
    Every time you click on a little square, the color appears in the swatch box.
    Note that clicking on the dot at the bottom of the color window and dragging down will expand the squares so that you can store over 100 custom colors.

  • Is it possible to change the color settings of ides 4.7 to make it appear .

    hi all...
    I want to take some snapshots from ides 4.7. Please tell is it possible to change the color tone of ides 4.7 to make it appear like ECC 6. How to change the color settings?
    Thanks!

    Install Tweak SAP gui .

  • I would like to ask if is possible to predict a future version of iOS can have the possibility to choose the color with which to write and be able to choose the character also...

    I would like to ask if is possible to predict a future version of iOS can have the possibility to choose the color with which to write and be able to choose the character also...

    Nobody here would have a crystal ball and know what Apple plans on doing in the furture.
    If you feel this feature is so important, you can let Apple know:
    www.apple.com/feedback

  • Best way to alter Icon color/brightness

    Hello everyone,
    I would like to know what's the best/easiest way to alter the color and brightness of an Icon IE in a JLabel.
    I wish to do something like this:
    In a panel:
    JLabel picture = null;
    picture = new JLabel(new Icon(new BufferedImage(...));
    picture.setText("");
    add(picture);and then have two methods (IE: picture.shade() and picture.unshade()) to darken and brighten the icon in the JLabel at will, to simulate "active" and "not active" statuses.
    Thank you in advance!
    Fabio.

    FabioFranchello wrote:
    JLabel picture = null;
    picture = new JLabel(new Icon(new BufferedImage(...));
    You can't create an instance of Icon since it's an interface, you should create an ImageIcon:
    JLabel picture = new JLabel(new ImageIcon(new BufferedImage(...));
    picture.setText("");This is unnecessary - picture text is already the empty string.
    and then have two methods (IE: picture.shade() and picture.unshade()) to darken and brighten the icon in the JLabel at will, to simulate "active" and "not active" statuses.You will need to change the brightness of the image: [http://java.sun.com/developer/JDCTechTips/2004/tt0210.html]

Maybe you are looking for