Python – Find dominant/most common color in an image

Here’s code making use of Pillow and Scipy’s cluster package. For simplicity I’ve hardcoded the filename as “image.jpg”. Resizing the image is for speed: if you don’t mind the wait, comment out the resize call. When run on this sample image, it usually says the dominant colour is #d8c865, which corresponds roughly to the bright … Read more

android popup menu text color (AppCompat)

In styles.xml <style name=”itemTextStyle.AppTheme” parent=”@android:style/TextAppearance.Widget.IconMenu.Item”> <item name=”android:textColor”>@drawable/color_item_popup</item> <item name=”android:textSize”>@dimen/text_content</item> </style> and add in AppTheme <item name=”android:itemTextAppearance”>@style/itemTextStyle.AppTheme</item> color_item_popup.xml <selector xmlns:android=”http://schemas.android.com/apk/res/android”> <item android:state_pressed=”true” android:color=”@color/primary_text”/> <item android:state_focused=”true” android:color=”@color/primary_text”/> <item android:color=”@color/secondary_text”/> </selector>

What are the default color values for the Holo theme on Android 4.0?

If you want the default colors of Android ICS, you just have to go to your Android SDK and look for this path: platforms\android-15\data\res\values\colors.xml. Here you go: <!– For holo theme –> <drawable name=”screen_background_holo_light”>#fff3f3f3</drawable> <drawable name=”screen_background_holo_dark”>#ff000000</drawable> <color name=”background_holo_dark”>#ff000000</color> <color name=”background_holo_light”>#fff3f3f3</color> <color name=”bright_foreground_holo_dark”>@android:color/background_holo_light</color> <color name=”bright_foreground_holo_light”>@android:color/background_holo_dark</color> <color name=”bright_foreground_disabled_holo_dark”>#ff4c4c4c</color> <color name=”bright_foreground_disabled_holo_light”>#ffb2b2b2</color> <color name=”bright_foreground_inverse_holo_dark”>@android:color/bright_foreground_holo_light</color> <color name=”bright_foreground_inverse_holo_light”>@android:color/bright_foreground_holo_dark</color> <color name=”dim_foreground_holo_dark”>#bebebe</color> <color … Read more