Wikipedia:Reference desk/Archives/Computing/2012 November 12

= November 12 =

how to tweak an entire color pallete at once?
I've got a CSS theme that I like. It consists of perhaps a dozen colors that all go well together. There is a "cornerstone color" that the rest are basing off of - lighter, darker, complimentary, etc. I have all the hexcodes.

What I'd like to do is change the cornerstone color to my color of choice, and have all the related colors follow this "shift" appropriately.

In theory this is just (original color pallete) + (constant shift) = final pallete but I have no idea how one could go about doing this in hexcodes. The Masked Booby (talk) 03:20, 12 November 2012 (UTC)


 * It would be a waste of time because we already have stuff like http://colorschemedesigner.com/ and https://kuler.adobe.com/. If you chose the cornerstone color those tools will do the rest. Trio The Punch (talk) 03:27, 12 November 2012 (UTC)


 * Note that your method may exceed the maximum values. For example, if you have RGB values of (200,200,200) on a 0-255 scale, and add 100 to each, that gives you (300,300,300).  What would you do then ? StuRat (talk) 07:14, 12 November 2012 (UTC)


 * You limit them at 255, obviously. --Mr.98 (talk) 13:50, 12 November 2012 (UTC)


 * Then you end up with a color which was (200,200,200) now being indistinguishable from one that was (255,255,255). Rather than just adding, a more complex method is needed to ensure that each color stays unique.  A nonlinear gamma correction histogram is one method used.  Finley talks about this below. StuRat (talk) 19:07, 12 November 2012 (UTC)


 * How to do it: basically you'll probably need to use Javascript for this. Pure CSS has some ability to computed values but support varies by browser and it's probably too much of a pain anyway to worry about. So set up your layout, and give everything an extra class descriptor that tells you what color it should be (e.g. "cornerstone" vs. "cornerstoneplus1" vs. "cornerstoneplus2" and so on). These can just be appended on (with a space) to any other class descriptors you have. Then set up a function that is launched in the BODY's OnLoad event that changes your CSS rules to set your "cornerstone" class to an initial color, then runs through as many variation classes as you want, and uses the RGB to calculate their changed colors. You may have to do things like put limits or cliff on them so they don't go over 255 but this is trivial. If you need more help on this, just ask. A basic primer for changing CSS rules on the fly with Javascript is here. You should be aware, though, that raw adding offset values to RGB is not necessarily going to produce nice results — generally speaking, if you just add equal-ish number to RGB, you just get lighter colors. That might be what you want, but there may be some tinkering involved. --Mr.98 (talk) 13:48, 12 November 2012 (UTC)


 * Reasoning about colour in RGB space can be counter-intuitive. It may be clearer to convert the RGB points into HSL or HSV, perform the transformations there, and convert back to RGB. Simply changing each point's h ue coordinate will rotate it around the colour wheel - you can apply the same change to each point and the system will keep the same perceptual distance between them. If you want to alter the points' other values (saturation and {value or lightness}), you might apply a uniform scaling factor to each  - at least as a first attempt; a non-uniform scaling curve might have better perceptual characteristics (cf Gamma correction), as S and L (or V) run from 0->1, so one can blow out the palette (where the clamped values are clustered near 0 or 1) if one isn't careful. This question has some sample code, and links to RGB->HSV->RGB converter code. -- Finlay McWalterჷTalk 15:43, 12 November 2012 (UTC)

You can script this pretty easily using ImageMagick, particularly its  command. ¦ Reisio (talk) 18:34, 12 November 2012 (UTC)

wifi problem
Hello. I have a wifi and two laptops, one windows 7, one kubuntu linux, in my house (NZ). I use internet banking but when I try to log in to the bank from the linux machine, both machines immediately lose connection to the internet. This happens repeatably. Every single time. Over and over again. Internet banking from the windows machine is fine, AFAICS. Also, I can log in to my other bank account (in the UK) fine from either machine. What gives? Robinh (talk) 06:37, 12 November 2012 (UTC)

SMD mounting
Hi theRE! I got a decent solder station an was contemplating installing an SMD based chip to one of my PCBs

So I JUSt wanted to ask you guys- is it appropriate and ok to do it or do you need some more sophisticated hardware to have SMD chips soldered with no problems???

I havent done any smds before though COuld you fk it up if something goes wrong or something — Preceding unsigned comment added by 77.35.14.23 (talk) 11:38, 12 November 2012 (UTC)
 * There are many, many, many guides for mounting SMD components at home including videos ones etc on the internet. The most common recommendation is using soldering paste and a toaster oven with a fine tip soldering iron for any touch up needed. It's not entirely clear what your decent soldering station consists of, it may be useful for touchups or if any reworks are needed and perhaps also for placing the components initially. Particularly if your soldering stations has a hot air gun, it may also be suitable if you only need to place one component, but longer term if you plan to be resonably regularly working with SMD components you may want to consider another solution. Either way, reading the many, many, many existing guides out there should help a great deal. Nil Einne (talk) 12:32, 12 November 2012 (UTC)

Flashing arbitrary code to firmware chips on modern PCs
I'm curious about upcoming Windows 8 devices and current devices. In general, do many motherboards verify the BIOS or EFI firmware in the chip? This was talked about as a way of getting around the secure boot requirements for Windows 8. --Melab±1 &#9742; 22:57, 12 November 2012 (UTC)
 * Most x86 motherboards which still use BIOS do not verify the BIOS firmware in any way other then via a checksum. This should be obvious since with both Windows Vista and Windows 7, using a modified BIOS to stimulate SLIC and OEM licencing was a very common method of getting around the online activation requirement. I believe it's the same for many UEFI devices. However if Secure Boot is enabled, then I'm resonably sure you shouldn't be able to do this (whether you can in practice I can't say), that's after all one of the points of Secure Point. All in all, it's a moot point since secure boot is not a big concern with x86 devices anyway as you are supposed to be able to disable it there. It's ARM devices where it's a big concern and there have been few ARM motherboards intended to be user customised if we ignore developmental platforms. Nil Einne (talk) 07:39, 13 November 2012 (UTC)


 * Windows 8 does not itself have secure boot requirements, and you can boot Windows 8 off a current BIOS machine without UEFI or TPM right now, perfectly legally. The requirements for UEFI Secure Boot come from the Windows 8 Hardware Certification Requirements. Those are the standards a PC has to pass in order to display the "ready for windows 8" logo; more importantly, the large OEM pricing deals that companies like HP and Dell sign with Microsoft entail they only ship Windows 8 on certified hardware.  The crucial part for this topic is the section entitled System.Fundamentals.Firmware.UEFISecureBoot (which begins on page 121 of the PDF). That mandates UEFI with SecureBoot, shipped enabled, with the Microsoft key in its key database (section 2). Section 8 mandates that UEFI boot device updates must use a cryptographic signature (so you can no longer flash a custom ROM image on to it, like Coreboot). But note that nowhere is there a requirement that Microsoft's key be the only key in the UEFI key database. And crucially section 17 (p124) prescribes this mandatory behaviour: "It shall be possible for a physically present user to use the Custom Mode firmware setup option to modify the contents of the Secure Boot signature databases and the PK." And section 18 says, again for non-ARM systems, that a physically present user can disable secure boot altogether (or, for a server, an admin connected over secure channel to hardware like a Dell DRAC card rather than just "physically present"). So you can disable secure boot, and you can add new keys to the key database.  This posting from Matthew Garrett at Red Hat talks about adding your own keys, so you can get a verifying boot chain when you're booting something other than Windows 8 - having this is useful for Linux (etc.) in general, as it greatly hampers rootkits - and it's really important for vertical linux deployments for sensitive devices like voting machines, ATMs, and lottery kiosks. One thing I don't fully understand is verification for UEFI option ROMs (the  PE32 binaries present in flash memory devices on adapter cards like graphics and network adapters) - UEFI SecureBoot requires that these be signature-verified too: I'm assuming this means that the ROMs in a Win8-certified machine will have to have certificates signed by Microsoft's RSA key (which is public) meaning that a non-Microsoft bootloader should be able to use that public key to verify the options ROMs (I think). -- Finlay McWalterჷTalk 17:54, 13 November 2012 (UTC)