Change the background color of a pop-up dialog

To expand on @DaneWhite’s answer, you don’t have to rely on the built-in themes. You can easily supply your own style: <style name=”MyDialogTheme” parent=”Theme.AppCompat.Light.Dialog.Alert”> <item name=”android:background”>@color/myColor</item> </style> and then apply it in the Builder constructor: Java: AlertDialog alertDialog = new AlertDialog.Builder(getContext(), R.style.MyDialogTheme) … .create(); Kotlin: var alertDialog = AlertDialog.Builder(context, R.style.MyDialogTheme) … .create() This should work … Read more

How to change text or background color in a Windows console application

You can change the colors for a console application using Win32 and here’s an example on how to: #include “stdafx.h” #include <Windows.h> #include <iostream> using namespace std; int main(void) { HANDLE hStdout = GetStdHandle(STD_OUTPUT_HANDLE); if (hStdout == INVALID_HANDLE_VALUE) { cout << “Error while getting input handle” << endl; return EXIT_FAILURE; } //sets the color to … Read more

How to set text color of a TextView programmatically? [duplicate]

Use,.. Color.parseColor(“#bdbdbd”); like, mTextView.setTextColor(Color.parseColor(“#bdbdbd”)); Or if you have defined color code in resource’s color.xml file than (From API >= 23) mTextView.setTextColor(ContextCompat.getColor(context, R.color.<name_of_color>)); (For API < 23) mTextView.setTextColor(getResources().getColor(R.color.<name_of_color>));

Is this possible to create 2-axis 4 color gradient in css (bilinear gradient)?

mask combined with linear-gradient can do it: .box { height: 200px; width: 300px; background: linear-gradient(to right, rgb(238, 252, 83), rgb(120, 239, 197)) } .box::before { content: “”; display: block; height: 100%; background: linear-gradient(to right, rgb(253, 67, 205), rgb(74, 68, 215)); -webkit-mask: linear-gradient(to bottom,#0000, #000); mask: linear-gradient(to bottom,#0000, #000); } <div class=”box”></div> Another kind of coloration: … Read more