Accent color windows 10

Содержание
  1. How to fix accent color option not available on Windows 10
  2. How to fix accent color for Start, taskbar, action center
  3. More Windows 10 resources
  4. Comparing Dell’s premium XPS 15 to the Inspiron 15 7000
  5. The Lenovo Legion Phone Dual 2 could be perfect for Xbox Cloud Gaming
  6. Hands-on with Windows 10 build 21354 showcasing new changes and features
  7. These are the best PC sticks when you’re on the move
  8. How to set a custom accent color for Windows 10
  9. Custom accent color picker
  10. 1. Run
  11. 2. Command
  12. 3. Enable
  13. 4. Pick
  14. Comparing Dell’s premium XPS 15 to the Inspiron 15 7000
  15. The Lenovo Legion Phone Dual 2 could be perfect for Xbox Cloud Gaming
  16. Hands-on with Windows 10 build 21354 showcasing new changes and features
  17. These external monitors go perfectly with the Lenovo ThinkPad X1 Carbon
  18. How to Add Custom Accent Colors to Windows 10
  19. Add a Custom Accent Color Using the Mixer
  20. Add a Custom Accent Color Using the Registry
  21. How to choose a custom accent color on Windows 10
  22. How to set a custom accent color
  23. How to set a custom solid color desktop background
  24. Цвет Color
  25. Цветовые принципы Color principles
  26. Темы Themes
  27. Светлая тема Light theme
  28. Темная тема Dark theme
  29. Изменение темы Changing the theme
  30. Тестирование тем Testing themes
  31. Кисти темы Theme brushes
  32. Использование кистей темы Using theme brushes
  33. Цвет элементов Accent color
  34. Переопределение цвета элементов Overriding the accent color
  35. Выбор цвета элементов Choosing an accent color
  36. Палитра цветов элементов Accent color palette
  37. API цветов Color API
  38. Определение области системных цветов Scoping system colors
  39. Использование ColorPaletteResources How to use ColorPaletteResources
  40. Применение цветов с заданной областью How to apply scoped colors
  41. Вложение ресурсов с заданной областью Nesting scoped resources
  42. Определение области с помощью ResourceDictionary Scoping with a ResourceDictionary
  43. MyCustomTheme.xaml MyCustomTheme.xaml
  44. MainPage.xaml MainPage.xaml
  45. Другие способы определения цветовых ресурсов Other ways to define color resources
  46. Удобство использования Usability

How to fix accent color option not available on Windows 10

Source: Windows Central

Windows 10 allows you to customize the appearance in several ways, including selecting a color mode and accent color for many surfaces like windows borders, title bars, Start menu, taskbar, and action center.

However, if you’re selecting an accent color for your desktop, you’ll probably notice that the «Start, taskbar, and action center» is grayed out, so you can’t use it. If this happens in your setup, it’s not a bug. It’s an expected behavior on Windows 10 if you’re currently using the Light mode, and you can resolve this issue by making modifications to the personalization settings.

In this Windows 10 guide, we’ll walk you through the easy steps to make the accent color option for Start, taskbar, and action center available on your device.

How to fix accent color for Start, taskbar, action center

To make the accent color option for Start, taskbar, and action center available on Windows 10, use these steps:

Use the «Choose your color» drop-down menu and select the Dark or Custom option.

Source: Windows Central

Quick tip: If you’re using the Custom option, make sure you select the Dark option for «Windows mode.»

Under the «Show accent color on the following surfaces» section, you can now check the Start, taskbar, and action center option.

Source: Windows Central

Once you complete the steps, surfaces like the Start menu, action center, and the taskbar will now show the accent color you selected in the Colors settings page.

You can fully customize the look and feel of your desktop using this comprehensive guide, and you can use these steps to optimize the taskbar space on Windows 10.

More Windows 10 resources

For more helpful articles, coverage, and answers to common questions about Windows 10, visit the following resources:

Comparing Dell’s premium XPS 15 to the Inspiron 15 7000

The Dell XPS 15 (9500) is an extraordinary 15-inch Ultrabook, but its price might be too high for a lot of people. The budget Inspiron 15 7000 (7501) is a great alternative, but how does it compare?

The Lenovo Legion Phone Dual 2 could be perfect for Xbox Cloud Gaming

The newly announced Lenovo Legion Phone Dual 2 has some of the highest-end specs you can get in a phone. While some of them are overkill for game streaming, it could be the ultimate device for Xbox Cloud Gaming.

Hands-on with Windows 10 build 21354 showcasing new changes and features

We’re back with another Windows Central build video walkthrough. Today, we’re taking a look at Windows 10 build 21354 that was just released in the Insider Dev Channel. It’s the first co_release build, but that doesn’t mean there aren’t new changes to check out.

These are the best PC sticks when you’re on the move

Instant computer — just add a screen. That’s the general idea behind the ultra-portable PC, but it can be hard to know which one you want. Relax, we have you covered!

Источник

How to set a custom accent color for Windows 10

Windows 10 is bringing a few options to customize the way things look. In fact, we wrote up a massive tome of all the various options you have at your disposal:

One of the more hidden abilities is to set a custom accent color. Microsoft lets you choose from a palette of 49 hues, which is probably fine for most users. In fact, you can let Windows auto-match the color according to your wallpaper.

However, you can go further and pick an exact color, including saturation, hue, intensity, and brightness. This feature is actually hidden, but with a simple run command you can have access to it. Let’s see how.

Custom accent color picker

1. Run

Use Win + R to bring up the run command window, or type Run into Cortana/search box on the taskbar

2. Command

Type in (or copy and paste) Control Color and hit OK

3. Enable

Reveal the extended menu by clicking on Show color mixer

4. Pick

If you are using the release version of Windows 10 build 10240, the color changes the Start menu, Action Center, and Taskbar. If you are on the Insider build of 10525 or later, the color you also choose changes the Title bar on apps.

Of course, nothing is permanent. If you would like to undo the change, just go into All Settings > Personalization > Colors. From this area, you can let Windows auto-select an accent color based on your background again or use one of the 49 presets.

Most people should be okay with the default options in Windows 10, but for those who have a real peculiar hue that they want, this trick should help you out!

For more resources, don’t forget to check our Windows 10 help, tips, and tricks page. Or if you have any questions, you can always count on our Windows 10 Forums at Windows Central for more help.

Comparing Dell’s premium XPS 15 to the Inspiron 15 7000

The Dell XPS 15 (9500) is an extraordinary 15-inch Ultrabook, but its price might be too high for a lot of people. The budget Inspiron 15 7000 (7501) is a great alternative, but how does it compare?

The Lenovo Legion Phone Dual 2 could be perfect for Xbox Cloud Gaming

The newly announced Lenovo Legion Phone Dual 2 has some of the highest-end specs you can get in a phone. While some of them are overkill for game streaming, it could be the ultimate device for Xbox Cloud Gaming.

Hands-on with Windows 10 build 21354 showcasing new changes and features

We’re back with another Windows Central build video walkthrough. Today, we’re taking a look at Windows 10 build 21354 that was just released in the Insider Dev Channel. It’s the first co_release build, but that doesn’t mean there aren’t new changes to check out.

These external monitors go perfectly with the Lenovo ThinkPad X1 Carbon

The Lenovo ThinkPad X1 Carbon is an excellent laptop, but what if you want to project the display onto a larger screen? You’ll need an external monitor for that. Here are our favorite options.

Источник

How to Add Custom Accent Colors to Windows 10

It’s easy to change Windows 10’s accent colors, the shades that appear in your taskbar, Start menu, settings menus and in some window title bars. However, by default, the operating system only allows you to choose from a predefined palette of 48 colors. If you want your taskbar to exactly match your company’s logo shade or, if your favorite hue of yellow isn’t one of the default four dozen, there are a couple of ways to add your own custom hue.

Читайте также:  Net framework для windows 7 x64 пакет

Add a Custom Accent Color Using the Mixer

If you don’t have a precise color to match and just want to fiddle with some controls until you get an accent shade you like, you can use Windows 10’s color mixer. If you have the RGB or Hex code for a particular color, you’ll have to use the other method: adding custom colors to the registry.

1. Open the run prompt by hitting Windows + R or typing «Run» into the search box.

2. Type «Control Color» into the run box and hit Ok.

A window appears with a list of colors.

3. Select the color block that is closest to what you want. The window title bar will change to match that color.

4. Open «Show color mixer.»

5. Adjust the Hue, Saturation and Brightness bars until you get a color you like. As you move the sliders, you will see a preview of the color in the window title bar.

6. Click Save Changes.

Add a Custom Accent Color Using the Registry

If you have an exact color you want to use as an accent color, you need to edit the Windows registry to add it. The «color mixer» method described above just isn’t precise enough.

1. Open the registry editor by typing «regedit» into run box or the search box and hitting Enter.

2. Navigate to HKEY_LOCAL_Machine\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\ by opening the folders in the left pane.

4. Open the Accents key.

5. Create a subkey named «0» under Accents and another named «Theme0» under that.

7. Open the Color DWORD value by double-clicking on it.

8. Enter a color value in ABGR (also called KML) format and click OK. ABGR stands for Alpha Blue Green Red and is composed of hexadecimal numbers. This tool will convert regular hex or RGB colors you get from an image editor into ABGR.

9. Close Regedit and restart your computer.

The new color will now appear at the bottom of the list of hues in the Accent color menu.

You can add up to seven additional custom colors to the menu by creating additional theme folders under the Accents key in the Windows registry. You need to name these Accents\0\Theme1, Accents\1\Theme0, Accents\1\Theme1, Accents\2\Theme0, \Accents\2\Theme1, Accents\3\Theme0 and Accents\3\Theme1.

Источник

How to choose a custom accent color on Windows 10

Windows 10 Creators Update adds a new option to pick a custom accent color and for solid color desktop background — Here’s how to do it.

The Creators Update for Windows 10 adds new option to choose a custom accent color. Before the Windows 10 Creators Update, you were able to change the accent color to make your experience a little more personal. However, Windows 10 only included a limited number of colors that you can choose from.

You’re able to use Control Panel’s Color and Appearance to customize color accent, but the OS removed this option with the Anniversary Update. Also, there was a workaround that involved editing the Registry, but it wasn’t practical, and it didn’t work for many users.

Fortunately, on “Windows 10 version 1703”, Microsoft is introducing a new color pickers to set any accent color you want to see throughout the OS, and there is even an option to select a custom color when setting a solid color as background on your desktop.

In this guide, you’ll learn the steps to choose a custom accent color on Windows 10, and how to set a custom color when setting a solid color desktop background.

How to set a custom accent color

To set a custom accent color on Windows 10, do the following:

Open Settings.

Click on Personalization.

Click on Colors.

Under “Windows colors”, click the Custom color button.

Custom color settings

Select the color you want using the color picker.

Choose a custom accent color

See the “Color preview” to get a glimpse of how the new color choice will look.

If you know exactly the color you want to use, click the More button, and enter the RGB or HSV color you want.

Specific RGB/HSV custom color settings

Click the Done button to complete the task.

Once you completed the steps, you’ll see your new custom color in the Taskbar, Start menu, windows, and throughout the OS.

The only caveat is that even though you can virtually pick any color, Windows 10 won’t let you pick certain colors, because they may be hard to read or not supported.

How to set a custom solid color desktop background

On the Windows 10 Creators Update, it’s also possible to pick a custom for your desktop background, which is something that wasn’t possible in previous versions.

To choose a custom solid desktop background, do the following:

Open Settings.

Click on Personalization.

Click on Background.

Under “Background”, select Solid color.

Click the Custom color button.

Custom color for desktop background

Select the color you want using the color picker.

Pick custom background color

See the “Color preview” to get a glimpse of how the new color choice will look.

If you know exactly the color you want to use, click the More button, and enter RGB or HSV color.

Click the Done button to complete the task.

Once you completed the steps, your new custom color will appear on your desktop. Unlike using a custom accent color, you can pick any color you want for your desktop background.

If you can’t add a custom accent color on your device, it’s probably because you’re not yet running the Windows 10 Creators Update, which is set to release in mid-April 2017.

Originally published on March 2017, updated on April 2017.

We may earn commission for purchases using our links to help keep offering the free content. Privacy policy info.

All content on this site is provided with no warranties, express or implied. Use any information at your own risk. Always backup of your device and files before making any changes. Privacy policy info.

Источник

Цвет Color

Цвет — это интуитивно понятный способ передачи информации пользователям в приложении. Его можно применять для обозначения интерактивных возможностей, обратной связи на действия пользователя, а также создания ощущения визуальной непрерывности интерфейса. Color provides an intuitive way of communicating information to users in your app: it can be used to indicate interactivity, give feedback to user actions, and give your interface a sense of visual continuity.

В приложениях Windows цвета в первую очередь определяются цветом элементов и темой. In Windows apps, colors are primarily determined by accent color and theme. В этой статье мы обсудим, как использовать цвет в приложении и как применять цвет элементов и ресурсы темы, чтобы ваше приложение Windows работало в контексте любой темы. In this article, we’ll discuss how you can use color in your app, and how to use accent color and theme resources to make your Windows app usable in any theme context.

Цветовые принципы Color principles

Используйте цвет осмысленно. Use color meaningfully. Использование цвета для выделения важных элементов поможет создать гибкий и интуитивно понятный интерфейс. When color is used sparingly to highlight important elements, it can help create a user interface that is fluid and intuitive.

Используйте цвет для обозначения интерактивных возможностей. Use color to indicate interactivity. Рекомендуется выбрать один цвет для обозначения интерактивных элементов приложения. It’s a good idea to choose one color to indicate elements of your application that are interactive. Например, на многих веб-страницах синий текст обозначает гиперссылки. For example, many web pages use blue text to denote a hyperlink.

Цвет отражает личные предпочтения. Color is personal. В Windows пользователи могут выбирать цвет элементов, а также светлую или темную тему, чтобы применить эти настройки системно. In Windows, users can choose an accent color and a light or dark theme, which are reflected throughout their experience. Вы можете выбрать способ применения выбираемых пользователем цветов и тем в приложении для персонализации взаимодействия. You can choose how to incorporate the user’s accent color and theme into your application, personalizing their experience.

Читайте также:  Vmxnet3 driver windows 10

Цвет отражает культурные особенности. Color is cultural. Подумайте о том, как применяемые цвета будут интерпретироваться пользователями из разных культур. Consider how the colors you use will be interpreted by people from different cultures. Например, в некоторых странах синий цвет ассоциируется с достоинством и защитой, а в других странах он символизирует печаль. For example, in some cultures the color blue is associated with virtue and protection, while in others it represents mourning.

Темы Themes

В приложениях Windows может использоваться светлая или темная тема. Windows apps can use a light or dark application theme. Тема определяет цвета фона, текста, значков и общих элементов управления приложения. The theme affects the colors of the app’s background, text, icons, and common controls.

Светлая тема Light theme

Темная тема Dark theme

По умолчанию тема приложения Windows — это тема, выбранная пользователем в параметрах Windows, или стандартная тема устройства (например, темная тема на консоли Xbox). By default, your Windows app’s theme is the user’s theme preference from Windows Settings or the device’s default theme (i.e., dark on Xbox). Однако вы можете настроить тему для вашего приложения Windows. However, you can set the theme for your Windows app.

Изменение темы Changing the theme

Удаление свойства RequestedTheme означает, что приложение будет применять системные параметры пользователя. Removing the RequestedTheme property means that your application will use the user’s system settings.

Пользователи также могут выбрать тему с высокой контрастностью, в которой применяется небольшая палитра контрастных цветов, благодаря чему интерфейс хорошо видно. Users can also select the high contrast theme, which uses a small palette of contrasting colors that makes the interface easier to see. В этом случае система переопределит свойство RequestedTheme. In that case, the system will override your RequestedTheme.

Тестирование тем Testing themes

Если вы не запрашиваете тему для приложения, обязательно протестируйте приложение в светлой и темной теме, чтобы убедиться, что оно читабельно в любом из этих состояний. If you don’t request a theme for your app, make sure to test your app in both light and dark themes to ensure that your app will be legible in all conditions.

Примечание. В Visual Studio по умолчанию в свойстве RequestedTheme указана светлая тема, так что вам потребуется изменить RequestedTheme для тестирования обеих тем. Note: In Visual Studio, the default RequestedTheme is light, so you’ll need to change the RequestedTheme to test both.

Кисти темы Theme brushes

Стандартные элементы управления автоматически используют кисти темы для адаптации к светлой и темной теме. Common controls automatically use theme brushes to adjust contrast for light and dark themes.

Например, ниже приведена иллюстрация того, как AutoSuggestBox использует кисти темы. For example, here’s an illustration of how the AutoSuggestBox uses theme brushes:

Кисти темы используются в следующих целях. The theme brushes are used for the following purposes:

Low/Medium/High обозначают интенсивность цвета. Low/Medium/High refer to the intensity of the color.

Использование кистей темы Using theme brushes

При создании шаблонов для пользовательских элементов управления применяйте кисти темы, а не закодированные значения цветов. When creating templates for custom controls, use theme brushes rather than hard code color values. Так приложение сможет легко адаптироваться к любой теме. This way, your app can easily adapt to any theme.

Например, эти шаблоны элементов для ListView демонстрируют использование кистей темы в пользовательском шаблоне. For example, these item templates for ListView demonstrate how to use theme brushes in a custom template.

Дополнительные сведения об использовании кистей тем в приложении см. в статье Ресурсы темы XAML. For more information about how to use theme brushes in your app, see Theme Resources.

Цвет элементов Accent color

Переопределение цвета элементов Overriding the accent color

Выбор цвета элементов Choosing an accent color

Если вы выбрали пользовательский цвет элементов для приложения, убедитесь, что текст и фон, которые его используют, достаточно контрастные для обеспечения оптимальной удобочитаемости. If you select a custom accent color for your app, please make sure that text and backgrounds that use the accent color have sufficient contrast for optimal readability. Для тестирования контрастности можно использовать средство выбора цвета в параметрах Windows или эти веб-средства проверки контрастности. To test contrast, you can use the color picker tool in Windows Settings, or you can use these online contrast tools.

Палитра цветов элементов Accent color palette

Алгоритм цвета элементов в оболочке Windows создает светлые и темные оттенки цвета элементов. An accent color algorithm in the Windows shell generates light and dark shades of the accent color.

Эти оттенки можно использовать как ресурсы темы: These shades can be accessed as theme resources:

Вы также можете получить доступ к палитре цветов элементов программными средствами с помощью метода UISettings.GetColorValue и перечисления UIColorType. You can also access the accent color palette programmatically with the UISettings.GetColorValue method and UIColorType enum.

С помощью палитры цветов элементов можно определить цветовую тему в приложении. You can use the accent color palette for color theming in your app. Ниже приведен пример того, как можно использовать палитру цветов элементов на кнопке. Below is an example of how you can use the accent color palette on a button.

При использовании цветного текста на цветном фоне убедитесь, что между текстом и фоном достаточно контраста. When using colored text on a colored background, make sure there is enough contrast between text and background. По умолчанию цвет элементов используется для гиперссылок и гипертекста. By default, hyperlink or hypertext will use the accent color. Если вы применяете варианты цвета элементов для фона, вам следует использовать вариант исходного цвета элементов для оптимизации контрастности цветного текста на цветном фоне. If you apply variations of the accent color to the background, you should use a variation of the original accent color to optimize the contrast of colored text on a colored background.

На приведенной ниже схеме показаны примеры различных светлых и темных оттенков цвета элементов и применения цветных типов на цветной поверхности. The chart below illustrates an example of the various light/dark shades of accent color, and how colored type can be applied on a colored surface.

Дополнительные сведения об использовании стилей для элементов управления см. в статье Стили XAML. For more information about styling controls, see XAML styles.

API цветов Color API

Существует несколько API-интерфейсов, позволяющих добавлять цвет в приложение. There are several APIs that can be used to add color to your application. Во-первых, это класс Colors, который реализует обширный список предопределенных цветов. First, the Colors class, which implements a large list of predefined colors. Доступ к ним можно получать автоматически с помощью свойств XAML. These can be accessed automatically with XAML properties. В приведенном ниже примере мы создаем кнопку и задаем свойства цвета фона и цвета переднего плана для элементов класса Colors. In the example below, we create a button and set the background and foreground color properties to members of the Colors class.

Вы можете создать собственные цвета из RGB- или шестнадцатеричных значений с помощью структуры Color в XAML. You can create your own colors from RGB or hex values using the Color struct in XAML.

Вы также можете создать такой цвет в коде с помощью метода FromArgb. You can also create the same color in code by using the FromArgb method.

Буквы «Argb» означают «альфа» (непрозрачность), «красный», «зеленый» и «синий» — четыре компонента цвета. The letters «Argb» stands for Alpha (opacity), Red, Green, and Blue, which are the four components of a color. Каждый аргумент может принимать значение от 0 до 255. Each argument can range from 0 to 255. Можно пропустить первое значение, чтобы использовать непрозрачность по умолчанию (255 или 100 %). You can choose to omit the first value, which will give you a default opacity of 255, or 100% opaque.

Если вы используете C++, вам необходимо создать цвета с помощью класса ColorHelper. If you’re using C++, you must create colors by using the ColorHelper class.

Чаще всего Color используется в качестве аргумента для метода SolidColorBrush, который можно применять для залива элементов пользовательского интерфейса одним сплошным цветом. The most common use for a Color is as an argument for a SolidColorBrush, which can be used to paint UI elements a single solid color. Эти кисти обычно определяются в ResourceDictionary, поэтому их можно повторно использовать для нескольких элементов. These brushes are generally defined in a ResourceDictionary, so they can be reused for multiple elements.

Читайте также:  Aptx установить на windows

Дополнительные сведения об использовании кистей см. в статье Кисти XAML. For more information on how to use brushes, see XAML brushes.

Определение области системных цветов Scoping system colors

В дополнение к определению собственных цветов в приложении, вы также можете использовать наши систематизированные цвета для желаемых областей в своем приложении с помощью тега ColorPaletteResources. In addition to defining your own colors in your app, you can also scope our systematized colors to desired regions throughout your app by using the ColorPaletteResources tag. Этот API-интерфейс позволяет не только одновременно выделять цветом большие группы элементов управления и задавать темы для них с помощью настройки нескольких свойств, но также обеспечивает другие системные преимущества, которые будут недоступны при определении своих собственных цветов вручную: This API allows you to not only colorize and theme large groups of controls at once by setting a few properties, but also gives you many other system benefits that you wouldn’t normally get with defining your own custom colors manually:

Использование ColorPaletteResources How to use ColorPaletteResources

ColorPaletteResources — это API, который сообщает системе, какие ресурсы находятся в определенной области. ColorPaletteResources is an API that tells the system what resources are being scoped where. ColorPaletteResources должен принимать значение x:Key, которое может быть в одном из трех вариантов: ColorPaletteResources must take an x:Key, that can be one of three choices:

Если вы захотите изменить внешний вид любой из тем, настройка значения x:Key обеспечит правильное изменение цветов в соответствии с темой системы или приложения. Setting that x:Key will ensure that your colors change appropriately to the system or app theme, should you want a different custom appearance when in either theme.

Применение цветов с заданной областью How to apply scoped colors

Применение области к ресурсам с помощью API ColorPaletteResources в XAML позволяет выбрать любой системный цвет или кисть, которые есть в нашей библиотеке ресурсов тем, и переопределить их в рамках страницы или контейнера. Scoping resources through the ColorPaletteResources API in XAML allows you to take any system color or brush that’s in our theme resources library and redefine them within the scope of a page or container.

к кнопке Button_A будут применены новые цвета, а кнопка Button_B останется похожей на нашу системную кнопку по умолчанию: You would get Button_A with the applied new colors, and Button_B would remain looking like our system default button:

Но так как все наши системные цвета распространяются на другие элементы управления, настройка BaseLow и BaseMediumLow повлияет не только на кнопки. However, since all our system colors cascade down to other controls too, setting BaseLow and BaseMediumLow will affect more than just buttons. В этом случае такие элементы управления, как ToggleButton, RadioButton и Slider, также будут зависеть от этих системных изменений цвета, если эти элементы управления будут помещены в область сетки в приведенном выше примере. In this case, controls like ToggleButton, RadioButton and Slider will also be effected by these system color changes, should those controls be put in above example grid’s scope. Если вы хотите изменить системный цвет только для одного элемента управления, определите ColorPaletteResources в ресурсах этого элемента управления: If you wish to scope a system color change to a single controls only you can do so by defining ColorPaletteResources within that control’s resources:

По сути, все останется по-прежнему, но теперь любые другие элементы управления, добавленные в сетку, не будут восприимчивы к изменениям цвета. You essentially have the exact same thing as before, but now any other controls added to the grid will not pick up the color changes. Это связано с тем, что эти системные цвета применяются только к кнопке Button_A. This is because those system colors are scoped to Button_A only.

Вложение ресурсов с заданной областью Nesting scoped resources

Вы также можете вложить системные цвета путем размещения ColorPaletteResources в ресурсах вложенных элементов в разметке макета вашего приложения: Nesting system colors is also possible, and is done so by placing ColorPaletteResources in the nested elements’ resources within the markup of your app layout:

В этом примере Button_A наследует цвета, определенные в ресурсах Grid_A, а вложенная кнопка наследует цвета из ресурсов Grid_B. In this example, Button_A is inheriting colors define in Grid_A‘s resources, and Nested Button is inheriting colors from Grid_B‘s resources. Это означает, что любые другие элементы управления, помещенные в Grid_B, сначала проверят или применят ресурсы Grid_B, потом проверят или применят ресурсы Grid_A, а затем применят наши цвета по умолчанию, если на уровне страницы или приложения ничего не определено. By extension, this means that any other controls placed within Grid_B will check or apply Grid_B‘s resources first, before checking or applying Grid_A‘s resources, and finally applying our default colors if nothing is defined at the page or app level.

Это работает для любого количества вложенных элементов с ресурсами, для которых определены цвета. This works for any number of nested elements whose resources have color definitions.

Определение области с помощью ResourceDictionary Scoping with a ResourceDictionary

Вы не ограничены ресурсами контейнера или страницы, а также можете определить эти системные цвета в ResourceDictionary, которые затем можно объединить в любой области, как обычно объединяют словарь. You are not limited to a container or page’s resources, and can also define these system colors in a ResourceDictionary that can then be merged at any scope the way you normally would merge a dictionary.

MyCustomTheme.xaml MyCustomTheme.xaml

Во-первых, создайте словарь ResourceDictionary. First, you would create a ResourceDictionary. Затем поместите класс ColorPaletteResources в раздел ThemeDictionaries и переопределите нужные системные цвета: Then place the ColorPaletteResources within the ThemeDictionaries and override the desired system colors:

MainPage.xaml MainPage.xaml

На странице, содержащей ваш макет, объедините этот словарь с нужной областью: On the page containing your layout, simply merge that dictionary in at the scope you want:

Теперь все ресурсы, темы и пользовательские цвета можно поместить в один словарь ресурсов MyCustomTheme и при необходимости указать область применения, не беспокоясь о беспорядке в разметке макета. Now, all resources, theming, and custom colors can be placed in a single MyCustomTheme resource dictionary and scoped where needed without having to worry about extra clutter in your layout markup.

Другие способы определения цветовых ресурсов Other ways to define color resources

Класс ColorPaletteResources также позволяет размещать системные цвета и определять их непосредственно внутри ресурса как в оболочке, а не как в строке: ColorPaletteResources also allows for system colors to be placed and defining directly within it as a wrapper, rather than in line:

Удобство использования Usability

Контрастность Contrast

Убедитесь, что элементы и изображения достаточно контрастные, чтобы их можно было различать независимо от темы или цвета элементов. Make sure that elements and images have sufficient contrast to differentiate between them, regardless of the accent color or theme.

В ходе принятия решения о применении цветов в приложении следует ориентироваться на доступность. When considering what colors to use in your application, accessibility should be a primary concern. Используйте приведенные ниже инструкции, чтобы убедиться, что приложение доступно для использования максимальному числу пользователей. Use the guidance below to make sure your application is accessible to as many users as possible.

Освещение Lighting

Имейте в виду, что особенности освещения могут влиять на удобство использования приложения. Be aware that variation in ambient lighting can affect the usability of your app. Например, страница с черным фоном может быть нечитаемой на улице из-за бликов, а страница с белым фоном может вызывать дискомфорт при просмотре в темной комнате. For example, a page with a black background might unreadable outside due to screen glare, while a page with a white background might be painful to look at in a dark room.

Цветовая слепота Colorblindness

Учитывайте то, как особенности восприятия цвета у некоторых пользователей могут влиять на удобство использования приложения. Be aware of how colorblindness could affect the usability of your application. Например, некоторые пользователи испытывают трудности при различении красных и зеленых элементов. For example, a user with red-green colorblindness will have difficulty distinguishing red and green elements from each other. Около 8 % мужчин и 0,5 % женщин не различают красный и зеленый цвета, поэтому не используйте их сочетание в качестве единственного отличия между элементами приложения. About 8 percent of men and 0.5 percent of women are red-green colorblind, so avoid using these color combinations as the sole differentiator between application elements.

Источник

Поделиться с друзьями
Советы экспертов и специалистов
Adblock
detector