Skip to content

Instantly share code, notes, and snippets.

View ilyapasyuk's full-sized avatar
🐈

Ilya Pasuyk ilyapasyuk

🐈
View GitHub Profile
@ilyapasyuk
ilyapasyuk / OpacityHex.markdown
Created June 10, 2022 22:21 — forked from creativecreatorormaybenot/OpacityHex.markdown
Opacity Percentage to Flutter Opacity Hex Color code

Flutter uses hexadecimal ARGB values for colors, which are formatted as const Color(0xAARRGGBB). That first pair of letters, the AA, represent the alpha channel. You must convert your decimal opacity values to a hexadecimal value. Here are the steps:

Alpha Hex Value Process

  • Take your opacity as a decimal value and multiply it by 255. So, if you have a block that is 50% opaque the decimal value would be .5. For example: .5 x 255 = 127.5

  • The fraction won't convert to hexadecimal, so you must round your number up or down to the nearest whole number. For example: 127.5 rounds up to 128; 55.25 rounds down to 55.

  • Enter your decimal value in a decimal-to-hexadecimal converter, like http://www.binaryhexconverter.com/decimal-to-hex-converter, and convert your values.

@ilyapasyuk
ilyapasyuk / GITHUB_INTEGRATION.md
Created March 10, 2020 23:17 — forked from Aliance/GITHUB_INTEGRATION.md
GitHub integration with Slack

FYI, 8 простых шагов по настройке оповещений из гитхаба в слак:

@ilyapasyuk
ilyapasyuk / axiosCached.js
Created March 10, 2020 23:13
Cache in Axios
import axios from 'axios';
import { cacheAdapterEnhancer } from 'axios-extensions';
const http = axios.create({
baseURL: '/',
headers: { 'Cache-Control': 'no-cache' },
// cache will be enabled by default
adapter: cacheAdapterEnhancer(axios.defaults.adapter)
});